gecko-mediaplayer-1.0.8/ 0000775 0001750 0001750 00000000000 12114222537 012104 5 0000000 0000000 gecko-mediaplayer-1.0.8/AUTHORS 0000664 0001750 0001750 00000000000 10762015264 013066 0000000 0000000 gecko-mediaplayer-1.0.8/install-sh 0000775 0001750 0001750 00000033255 12110165613 014035 0000000 0000000 #!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
gecko-mediaplayer-1.0.8/src/ 0000775 0001750 0001750 00000000000 12114222537 012673 5 0000000 0000000 gecko-mediaplayer-1.0.8/src/plugin_types_dvx.cpp 0000664 0001750 0001750 00000006661 12007254567 016744 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plugin_types.h"
gchar *GetMIMEDescription()
{
gchar MimeTypes[4000];
GmPrefStore *store;
gboolean dvx_disabled = FALSE;
g_type_init();
store = gm_pref_store_new("gecko-mediaplayer");
if (store != NULL) {
dvx_disabled = gm_pref_store_get_boolean(store, DISABLE_DVX);
gm_pref_store_free(store);
}
if (dvx_disabled) {
return NULL;
} else {
g_strlcpy(MimeTypes,
"video/divx:divx:DivX Media Format;"
"video/vnd.divx:divx:DivX Media Format;", sizeof(MimeTypes));
return g_strdup(MimeTypes);
}
}
NPError PluginGetValue(NPPVariable variable, void *value)
{
NPError err = NPERR_NO_ERROR;
// some sites use this description to figure out what formats can be played. So we have to make sure the
// description matches the features
if (variable == NPPVpluginNameString) {
*((const char **) value) = "DivX Browser Plug-In";
}
if (variable == NPPVpluginDescriptionString) {
*((const char **) value) =
"Gecko Media Player "
VERSION
"
Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer";
}
if (variable == NPPVpluginNeedsXEmbed) {
*((bool *) value) = TRUE;
}
if ((variable != NPPVpluginNameString)
&& (variable != NPPVpluginDescriptionString)
&& (variable != NPPVpluginNeedsXEmbed)) {
err = NPERR_INVALID_PARAM;
}
return err;
}
void pluginSpecific(CPlugin * instance)
{
instance->quicktime_emulation = FALSE;
}
gecko-mediaplayer-1.0.8/src/plugin_dbus.h 0000664 0001750 0001750 00000006775 12007254567 015327 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _PLUGIN_DBUS_H
#define _PLUGIN_DBUS_H
#include
#include
#include
#include
#include
// #include
#include "plugin.h"
#include "plugin_list.h"
// extern void dbus_connection_setup_with_qt_main (DBusConnection *connection);
DBusConnection *dbus_hookup(CPlugin * instance);
DBusConnection *dbus_unhook(DBusConnection * connection, CPlugin * instance);
void open_location(CPlugin * instance, ListItem * item, gboolean uselocal);
void resize_window(CPlugin * instance, ListItem * item, gint x, gint y);
void send_signal(CPlugin * instance, ListItem * item, const gchar * signal);
void send_signal_when_ready(CPlugin * instance, ListItem * item, const gchar * signal);
void send_signal_with_string(CPlugin * instance, ListItem * item, const gchar * signal,
gchar * str);
void send_signal_with_double(CPlugin * instance, ListItem * item, const gchar * signal,
gdouble dbl);
void send_signal_with_boolean(CPlugin * instance, ListItem * item, const gchar * signal,
gboolean boolean);
void send_signal_with_integer(CPlugin * instance, ListItem * item, const gchar * signal, gint val);
gboolean request_boolean_value(CPlugin * instance, ListItem * item, const gchar * member);
gdouble request_double_value(CPlugin * instance, ListItem * item, const gchar * member);
gint request_int_value(CPlugin * instance, ListItem * item, const gchar * member);
gchar *request_string_value(CPlugin * instance, ListItem * item, const gchar * member);
gboolean is_valid_path(CPlugin * instance, const char *message);
gint request_bitrate(CPlugin * instance, ListItem * item, gchar * name);
#endif // _PLUGIN_DBUS_H
gecko-mediaplayer-1.0.8/src/plugin_setup.h 0000664 0001750 0001750 00000004060 12007254567 015513 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _PLUGIN_SETUP_H
#define _PLUGIN_SETUP_H
#include "plugin_dbus.h"
// void new_instance(CPlugin * instance, nsPluginCreateData * parameters);
void new_instance(CPlugin * instance, int16_t argc, char *argn[], char *argv[]);
gboolean streaming(gchar * url);
#endif // _PLUGIN_SETUP_H
gecko-mediaplayer-1.0.8/src/plugin_types_std.cpp 0000664 0001750 0001750 00000014607 12007254567 016734 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plugin_types.h"
gchar *GetMIMEDescription()
{
gchar MimeTypes[8192];
GmPrefStore *store;
gboolean midi_disabled = FALSE;
g_type_init();
store = gm_pref_store_new("gecko-mediaplayer");
if (store != NULL) {
midi_disabled = gm_pref_store_get_boolean(store, DISABLE_MIDI);
gm_pref_store_free(store);
}
g_strlcpy(MimeTypes,
"audio/x-mpegurl:m3u:MPEG Playlist;"
"video/mpeg:mpg,mpeg:MPEG;"
"audio/mpeg:mpg,mpeg:MPEG;"
"video/x-mpeg:mpg,mpeg:MPEG;"
"video/x-mpeg2:mpv2,mp2ve:MPEG2;"
"audio/mpeg:mpg,mpeg:MPEG;"
"audio/x-mpeg:mpg,mpeg:MPEG;"
"audio/mpeg2:mp2:MPEG audio;"
"audio/x-mpeg2:mp2:MPEG audio;"
"audio/mp4:mp4:MPEG 4 audio;"
"audio/x-mp4:mp4:MPEG 4 audio;"
"video/mp4:mp4:MPEG 4 Video;"
"video/x-m4v:m4v:MPEG 4 Video;"
"video/3gpp:mp4,3gp:MPEG 4 Video;", sizeof(MimeTypes));
g_strlcat(MimeTypes,
"audio/mpeg3:mp3:MPEG audio;" "audio/x-mpeg3:mp3:MPEG audio;"
"audio/x-mpegurl:m3u:MPEG url;" "audio/mp3:mp3:MPEG audio;", sizeof(MimeTypes));
g_strlcat(MimeTypes,
"application/x-ogg:ogg,oga,ogm:Ogg Vorbis Media;"
"application/ogg:ogg,oga,ogm:Ogg Vorbis Media;"
"audio/x-ogg:ogg,oga:Ogg Vorbis Audio;"
"audio/ogg:ogg,oga:Ogg Vorbis Audio;"
"video/x-ogg:ogg,ogm:Ogg Vorbis Video;"
"video/ogg:ogg,ogm:Ogg Vorbis Video;", sizeof(MimeTypes));
// VLC
g_strlcat(MimeTypes,
"application/x-vlc-plugin:vlc:VLC plug-in;"
"application/x-google-vlc-plugin::Google VLC plug-in;", sizeof(MimeTypes));
// FLAC
g_strlcat(MimeTypes,
"audio/flac:flac:FLAC Audio;" "audio/x-flac:flac:FLAC Audio;", sizeof(MimeTypes));
// FLI
g_strlcat(MimeTypes,
"video/fli:fli,flc:FLI animation;"
"video/x-fli:fli,flc:FLI animation;", sizeof(MimeTypes));
// FLV
g_strlcat(MimeTypes, "video/x-flv:flv:Flash Video;"
"video/flv:flv:Flash Video;", sizeof(MimeTypes));
// Vivo
g_strlcat(MimeTypes, "video/vnd.vivo:viv,vivo:VivoActive;", sizeof(MimeTypes));
// Matroska
g_strlcat(MimeTypes, "audio/x-matroska:mka:Matroska Audio;", sizeof(MimeTypes));
g_strlcat(MimeTypes, "video/x-matroska:mkv:Matroska Video;", sizeof(MimeTypes));
// NSV
g_strlcat(MimeTypes,
"application/x-nsv-vp3-mp3:nsv:Nullsoft Streaming Video;", sizeof(MimeTypes));
// Soundtracker
g_strlcat(MimeTypes, "audio/x-mod:mod:Soundtracker;", sizeof(MimeTypes));
// AIFF
g_strlcat(MimeTypes, "audio/x-aiff:aif:AIFF Audio;", sizeof(MimeTypes));
// Basic
g_strlcat(MimeTypes,
"audio/basic:au,snd:Basic Audio File;"
"audio/x-basic:au,snd:Basic Audio File;", sizeof(MimeTypes));
// MIDI
if (!midi_disabled)
g_strlcat(MimeTypes, "audio/midi:mid,midi,kar:MIDI Audio;", sizeof(MimeTypes));
// Playlist
g_strlcat(MimeTypes, "audio/x-scpls:pls:Shoutcast Playlist;", sizeof(MimeTypes));
// MNG
g_strlcat(MimeTypes, "video/x-mng:mng:Multiple-Image Network Graphics;", sizeof(MimeTypes));
// WEBM
g_strlcat(MimeTypes,
"audio/webm:webm:WEBM audio File;"
"audio/x-webm:webm:WEBM audio File;"
"video/webm:webm:WEBM video File;"
"video/x-webm:webm:WEBM video File;", sizeof(MimeTypes));
return g_strdup(MimeTypes);
}
NPError PluginGetValue(NPPVariable variable, void *value)
{
NPError err = NPERR_NO_ERROR;
// some sites use this description to figure out what formats can be played. So we have to make sure the
// description matches the features
if (variable == NPPVpluginNameString) {
*((const char **) value) = "mplayerplug-in is now gecko-mediaplayer " VERSION;
}
if (variable == NPPVpluginDescriptionString) {
*((const char **) value) =
"Gecko Media Player "
VERSION
"
Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer";
}
if (variable == NPPVpluginNeedsXEmbed) {
*((bool *) value) = TRUE;
}
if ((variable != NPPVpluginNameString)
&& (variable != NPPVpluginDescriptionString)
&& (variable != NPPVpluginNeedsXEmbed)) {
err = NPERR_INVALID_PARAM;
}
return err;
}
void pluginSpecific(CPlugin * instance)
{
instance->quicktime_emulation = FALSE;
}
gecko-mediaplayer-1.0.8/src/npupp.h 0000664 0001750 0001750 00000064503 12007254567 014147 0000000 0000000 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* npupp.h $Revision: 3.26 $
* function call mecahnics needed by platform specific glue code.
*/
#ifndef _NPUPP_H_
#define _NPUPP_H_
#ifdef HAVE_CONFIG_H
#include
#endif
#if defined(__OS2__)
#pragma pack(1)
#endif
#ifndef GENERATINGCFM
#define GENERATINGCFM 0
#endif
#ifndef _NPAPI_H_
#include "npapi.h"
#endif
#include "npruntime.h"
/******************************************************************************************
plug-in function table macros
for each function in and out of the plugin API we define
typedef NPP_FooUPP
#define NewNPP_FooProc
#define CallNPP_FooProc
*******************************************************************************************/
/* NPP_Initialize */
typedef void (*NP_LOADDS NPP_InitializeUPP) (void);
#define NewNPP_InitializeProc(FUNC) \
((NPP_InitializeUPP) (FUNC))
#define CallNPP_InitializeProc(FUNC) \
(*(FUNC))()
/* NPP_Shutdown */
typedef void (*NP_LOADDS NPP_ShutdownUPP) (void);
#define NewNPP_ShutdownProc(FUNC) \
((NPP_ShutdownUPP) (FUNC))
#define CallNPP_ShutdownProc(FUNC) \
(*(FUNC))()
/* NPP_New */
typedef NPError(*NP_LOADDS NPP_NewUPP) (NPMIMEType pluginType, NPP instance, uint16_t mode,
int16_t argc, char *argn[], char *argv[],
NPSavedData * saved);
#define NewNPP_NewProc(FUNC) \
((NPP_NewUPP) (FUNC))
#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
/* NPP_Destroy */
typedef NPError(*NP_LOADDS NPP_DestroyUPP) (NPP instance, NPSavedData ** save);
#define NewNPP_DestroyProc(FUNC) \
((NPP_DestroyUPP) (FUNC))
#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \
(*(FUNC))((ARG1), (ARG2))
/* NPP_SetWindow */
typedef NPError(*NP_LOADDS NPP_SetWindowUPP) (NPP instance, NPWindow * window);
#define NewNPP_SetWindowProc(FUNC) \
((NPP_SetWindowUPP) (FUNC))
#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \
(*(FUNC))((ARG1), (ARG2))
/* NPP_NewStream */
typedef NPError(*NP_LOADDS NPP_NewStreamUPP) (NPP instance, NPMIMEType type, NPStream * stream,
NPBool seekable, uint16_t * stype);
#define NewNPP_NewStreamProc(FUNC) \
((NPP_NewStreamUPP) (FUNC))
#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
/* NPP_DestroyStream */
typedef NPError(*NP_LOADDS NPP_DestroyStreamUPP) (NPP instance, NPStream * stream, NPReason reason);
#define NewNPP_DestroyStreamProc(FUNC) \
((NPP_DestroyStreamUPP) (FUNC))
#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \
(*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg))
/* NPP_WriteReady */
typedef int32_t(*NP_LOADDS NPP_WriteReadyUPP) (NPP instance, NPStream * stream);
#define NewNPP_WriteReadyProc(FUNC) \
((NPP_WriteReadyUPP) (FUNC))
#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \
(*(FUNC))((NPParg), (NPStreamPtr))
/* NPP_Write */
typedef int32_t(*NP_LOADDS NPP_WriteUPP) (NPP instance, NPStream * stream, int32_t offset,
int32_t len, void *buffer);
#define NewNPP_WriteProc(FUNC) \
((NPP_WriteUPP) (FUNC))
#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \
(*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr))
/* NPP_StreamAsFile */
typedef void (*NP_LOADDS NPP_StreamAsFileUPP) (NPP instance, NPStream * stream, const char *fname);
#define NewNPP_StreamAsFileProc(FUNC) \
((NPP_StreamAsFileUPP) (FUNC))
#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPP_Print */
typedef void (*NP_LOADDS NPP_PrintUPP) (NPP instance, NPPrint * platformPrint);
#define NewNPP_PrintProc(FUNC) \
((NPP_PrintUPP) (FUNC))
#define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \
(*(FUNC))((NPParg), (NPPrintArg))
/* NPP_HandleEvent */
typedef int16_t(*NP_LOADDS NPP_HandleEventUPP) (NPP instance, void *event);
#define NewNPP_HandleEventProc(FUNC) \
((NPP_HandleEventUPP) (FUNC))
#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \
(*(FUNC))((NPParg), (voidPtr))
/* NPP_URLNotify */
typedef void (*NP_LOADDS NPP_URLNotifyUPP) (NPP instance, const char *url, NPReason reason,
void *notifyData);
#define NewNPP_URLNotifyProc(FUNC) \
((NPP_URLNotifyUPP) (FUNC))
#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
/* NPP_GetValue */
typedef NPError(*NP_LOADDS NPP_GetValueUPP) (NPP instance, NPPVariable variable, void *ret_alue);
#define NewNPP_GetValueProc(FUNC) \
((NPP_GetValueUPP) (FUNC))
#define CallNPP_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPP_SetValue */
typedef NPError(*NP_LOADDS NPP_SetValueUPP) (NPP instance, NPNVariable variable, void *ret_alue);
#define NewNPP_SetValueProc(FUNC) \
((NPP_SetValueUPP) (FUNC))
#define CallNPP_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/*
* Netscape entry points
*/
/* NPN_GetValue */
typedef NPError(*NP_LOADDS NPN_GetValueUPP) (NPP instance, NPNVariable variable, void *ret_alue);
#define NewNPN_GetValueProc(FUNC) \
((NPN_GetValueUPP) (FUNC))
#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPN_SetValue */
typedef NPError(*NP_LOADDS NPN_SetValueUPP) (NPP instance, NPPVariable variable, void *ret_alue);
#define NewNPN_SetValueProc(FUNC) \
((NPN_SetValueUPP) (FUNC))
#define CallNPN_SetValueProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPN_GetUrlNotify */
typedef NPError(*NP_LOADDS NPN_GetURLNotifyUPP) (NPP instance, const char *url, const char *window,
void *notifyData);
#define NewNPN_GetURLNotifyProc(FUNC) \
((NPN_GetURLNotifyUPP) (FUNC))
#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
/* NPN_PostUrlNotify */
typedef NPError(*NP_LOADDS NPN_PostURLNotifyUPP) (NPP instance, const char *url, const char *window,
uint32_t len, const char *buf, NPBool file,
void *notifyData);
#define NewNPN_PostURLNotifyProc(FUNC) \
((NPN_PostURLNotifyUPP) (FUNC))
#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7))
/* NPN_GetUrl */
typedef NPError(*NP_LOADDS NPN_GetURLUPP) (NPP instance, const char *url, const char *window);
#define NewNPN_GetURLProc(FUNC) \
((NPN_GetURLUPP) (FUNC))
#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPN_PostUrl */
typedef NPError(*NP_LOADDS NPN_PostURLUPP) (NPP instance, const char *url, const char *window,
uint32_t len, const char *buf, NPBool file);
#define NewNPN_PostURLProc(FUNC) \
((NPN_PostURLUPP) (FUNC))
#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
/* NPN_RequestRead */
typedef NPError(*NP_LOADDS NPN_RequestReadUPP) (NPStream * stream, NPByteRange * rangeList);
#define NewNPN_RequestReadProc(FUNC) \
((NPN_RequestReadUPP) (FUNC))
#define CallNPN_RequestReadProc(FUNC, stream, range) \
(*(FUNC))((stream), (range))
/* NPN_NewStream */
typedef NPError(*NP_LOADDS NPN_NewStreamUPP) (NPP instance, NPMIMEType type, const char *window,
NPStream ** stream);
#define NewNPN_NewStreamProc(FUNC) \
((NPN_NewStreamUPP) (FUNC))
#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \
(*(FUNC))((npp), (type), (window), (stream))
/* NPN_Write */
typedef int32_t(*NP_LOADDS NPN_WriteUPP) (NPP instance, NPStream * stream, int32_t len,
void *buffer);
#define NewNPN_WriteProc(FUNC) \
((NPN_WriteUPP) (FUNC))
#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \
(*(FUNC))((npp), (stream), (len), (buffer))
/* NPN_DestroyStream */
typedef NPError(*NP_LOADDS NPN_DestroyStreamUPP) (NPP instance, NPStream * stream, NPReason reason);
#define NewNPN_DestroyStreamProc(FUNC) \
((NPN_DestroyStreamUPP) (FUNC))
#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \
(*(FUNC))((npp), (stream), (reason))
/* NPN_Status */
typedef void (*NP_LOADDS NPN_StatusUPP) (NPP instance, const char *message);
#define NewNPN_StatusProc(FUNC) \
((NPN_StatusUPP) (FUNC))
#define CallNPN_StatusProc(FUNC, npp, msg) \
(*(FUNC))((npp), (msg))
/* NPN_UserAgent */
typedef const char *(*NP_LOADDS NPN_UserAgentUPP) (NPP instance);
#define NewNPN_UserAgentProc(FUNC) \
((NPN_UserAgentUPP) (FUNC))
#define CallNPN_UserAgentProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_MemAlloc */
typedef void *(*NP_LOADDS NPN_MemAllocUPP) (uint32_t size);
#define NewNPN_MemAllocProc(FUNC) \
((NPN_MemAllocUPP) (FUNC))
#define CallNPN_MemAllocProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN__MemFree */
typedef void (*NP_LOADDS NPN_MemFreeUPP) (void *ptr);
#define NewNPN_MemFreeProc(FUNC) \
((NPN_MemFreeUPP) (FUNC))
#define CallNPN_MemFreeProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_MemFlush */
typedef uint32_t(*NP_LOADDS NPN_MemFlushUPP) (uint32_t size);
#define NewNPN_MemFlushProc(FUNC) \
((NPN_MemFlushUPP) (FUNC))
#define CallNPN_MemFlushProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_ReloadPlugins */
typedef void (*NP_LOADDS NPN_ReloadPluginsUPP) (NPBool reloadPages);
#define NewNPN_ReloadPluginsProc(FUNC) \
((NPN_ReloadPluginsUPP) (FUNC))
#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_InvalidateRect */
typedef void (*NP_LOADDS NPN_InvalidateRectUPP) (NPP instance, NPRect * rect);
#define NewNPN_InvalidateRectProc(FUNC) \
((NPN_InvalidateRectUPP) (FUNC))
#define CallNPN_InvalidateRectProc(FUNC, ARG1, ARG2) \
(*(FUNC))((ARG1), (ARG2))
/* NPN_InvalidateRegion */
typedef void (*NP_LOADDS NPN_InvalidateRegionUPP) (NPP instance, NPRegion region);
#define NewNPN_InvalidateRegionProc(FUNC) \
((NPN_InvalidateRegionUPP) (FUNC))
#define CallNPN_InvalidateRegionProc(FUNC, ARG1, ARG2) \
(*(FUNC))((ARG1), (ARG2))
/* NPN_ForceRedraw */
typedef void (*NP_LOADDS NPN_ForceRedrawUPP) (NPP instance);
#define NewNPN_ForceRedrawProc(FUNC) \
((NPN_ForceRedrawUPP) (FUNC))
#define CallNPN_ForceRedrawProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_GetStringIdentifier */
typedef NPIdentifier(*NP_LOADDS NPN_GetStringIdentifierUPP) (const NPUTF8 * name);
#define NewNPN_GetStringIdentifierProc(FUNC) \
((NPN_GetStringIdentifierUPP) (FUNC))
#define CallNPN_GetStringIdentifierProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_GetStringIdentifiers */
typedef void (*NP_LOADDS NPN_GetStringIdentifiersUPP) (const NPUTF8 ** names,
int32_t nameCount,
NPIdentifier * identifiers);
#define NewNPN_GetStringIdentifiersProc(FUNC) \
((NPN_GetStringIdentifiersUPP) (FUNC))
#define CallNPN_GetStringIdentifiersProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPN_GetIntIdentifier */
typedef NPIdentifier(*NP_LOADDS NPN_GetIntIdentifierUPP) (int32_t intid);
#define NewNPN_GetIntIdentifierProc(FUNC) \
((NPN_GetIntIdentifierUPP) (FUNC))
#define CallNPN_GetIntIdentifierProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_IdentifierIsString */
typedef bool(*NP_LOADDS NPN_IdentifierIsStringUPP) (NPIdentifier identifier);
#define NewNPN_IdentifierIsStringProc(FUNC) \
((NPN_IdentifierIsStringUPP) (FUNC))
#define CallNPN_IdentifierIsStringProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_UTF8FromIdentifier */
typedef NPUTF8 *(*NP_LOADDS NPN_UTF8FromIdentifierUPP) (NPIdentifier identifier);
#define NewNPN_UTF8FromIdentifierProc(FUNC) \
((NPN_UTF8FromIdentifierUPP) (FUNC))
#define CallNPN_UTF8FromIdentifierProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_IntFromIdentifier */
typedef int32_t(*NP_LOADDS NPN_IntFromIdentifierUPP) (NPIdentifier identifier);
#define NewNPN_IntFromIdentifierProc(FUNC) \
((NPN_IntFromIdentifierUPP) (FUNC))
#define CallNPN_IntFromIdentifierProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_CreateObject */
typedef NPObject *(*NP_LOADDS NPN_CreateObjectUPP) (NPP npp, NPClass * aClass);
#define NewNPN_CreateObjectProc(FUNC) \
((NPN_CreateObjectUPP) (FUNC))
#define CallNPN_CreateObjectProc(FUNC, ARG1, ARG2) \
(*(FUNC))((ARG1), (ARG2))
/* NPN_RetainObject */
typedef NPObject *(*NP_LOADDS NPN_RetainObjectUPP) (NPObject * obj);
#define NewNPN_RetainObjectProc(FUNC) \
((NPN_RetainObjectUPP) (FUNC))
#define CallNPN_RetainObjectProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_ReleaseObject */
typedef void (*NP_LOADDS NPN_ReleaseObjectUPP) (NPObject * obj);
#define NewNPN_ReleaseObjectProc(FUNC) \
((NPN_ReleaseObjectUPP) (FUNC))
#define CallNPN_ReleaseObjectProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_Invoke */
typedef bool(*NP_LOADDS NPN_InvokeUPP) (NPP npp, NPObject * obj, NPIdentifier methodName,
const NPVariant * args, uint32_t argCount,
NPVariant * result);
#define NewNPN_InvokeProc(FUNC) \
((NPN_InvokeUPP) (FUNC))
#define CallNPN_InvokeProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6))
/* NPN_InvokeDefault */
typedef bool(*NP_LOADDS NPN_InvokeDefaultUPP) (NPP npp, NPObject * obj, const NPVariant * args,
uint32_t argCount, NPVariant * result);
#define NewNPN_InvokeDefaultProc(FUNC) \
((NPN_InvokeDefaultUPP) (FUNC))
#define CallNPN_InvokeDefaultProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
/* NPN_Evaluate */
typedef bool(*NP_LOADDS NPN_EvaluateUPP) (NPP npp, NPObject * obj, NPString * script,
NPVariant * result);
#define NewNPN_EvaluateProc(FUNC) \
((NPN_EvaluateUPP) (FUNC))
#define CallNPN_EvaluateProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
/* NPN_GetProperty */
typedef bool(*NP_LOADDS NPN_GetPropertyUPP) (NPP npp, NPObject * obj, NPIdentifier propertyName,
NPVariant * result);
#define NewNPN_GetPropertyProc(FUNC) \
((NPN_GetPropertyUPP) (FUNC))
#define CallNPN_GetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
/* NPN_SetProperty */
typedef bool(*NP_LOADDS NPN_SetPropertyUPP) (NPP npp, NPObject * obj, NPIdentifier propertyName,
const NPVariant * value);
#define NewNPN_SetPropertyProc(FUNC) \
((NPN_SetPropertyUPP) (FUNC))
#define CallNPN_SetPropertyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
/* NPN_RemoveProperty */
typedef bool(*NP_LOADDS NPN_RemovePropertyUPP) (NPP npp, NPObject * obj, NPIdentifier propertyName);
#define NewNPN_RemovePropertyProc(FUNC) \
((NPN_RemovePropertyUPP) (FUNC))
#define CallNPN_RemovePropertyProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPN_HasProperty */
typedef bool(*NP_LOADDS NPN_HasPropertyUPP) (NPP npp, NPObject * obj, NPIdentifier propertyName);
#define NewNPN_HasPropertyProc(FUNC) \
((NPN_HasPropertyUPP) (FUNC))
#define CallNPN_HasPropertyProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPN_HasMethod */
typedef bool(*NP_LOADDS NPN_HasMethodUPP) (NPP npp, NPObject * obj, NPIdentifier propertyName);
#define NewNPN_HasMethodProc(FUNC) \
((NPN_HasMethodUPP) (FUNC))
#define CallNPN_HasMethodProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPN_ReleaseVariantValue */
typedef void (*NP_LOADDS NPN_ReleaseVariantValueUPP) (NPVariant * variant);
#define NewNPN_ReleaseVariantValueProc(FUNC) \
((NPN_ReleaseVariantValueUPP) (FUNC))
#define CallNPN_ReleaseVariantValueProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_SetException */
typedef void (*NP_LOADDS NPN_SetExceptionUPP) (NPObject * obj, const NPUTF8 * message);
#define NewNPN_SetExceptionProc(FUNC) \
((NPN_SetExceptionUPP) (FUNC))
#define CallNPN_SetExceptionProc(FUNC, ARG1, ARG2) \
(*(FUNC))((ARG1), (ARG2))
/* NPN_PushPopupsEnabledStateUPP */
typedef bool(*NP_LOADDS NPN_PushPopupsEnabledStateUPP) (NPP npp, NPBool enabled);
#define NewNPN_PushPopupsEnabledStateProc(FUNC) \
((NPN_PushPopupsEnabledStateUPP) (FUNC))
#define CallNPN_PushPopupsEnabledStateProc(FUNC, ARG1, ARG2) \
(*(FUNC))((ARG1), (ARG2))
/* NPN_PopPopupsEnabledState */
typedef bool(*NP_LOADDS NPN_PopPopupsEnabledStateUPP) (NPP npp);
#define NewNPN_PopPopupsEnabledStateProc(FUNC) \
((NPN_PopPopupsEnabledStateUPP) (FUNC))
#define CallNPN_PopPopupsEnabledStateProc(FUNC, ARG1) \
(*(FUNC))((ARG1))
/* NPN_Enumerate */
typedef bool(*NP_LOADDS NPN_EnumerateUPP) (NPP npp, NPObject * obj, NPIdentifier ** identifier,
uint32_t * count);
#define NewNPN_EnumerateProc(FUNC) \
((NPN_EnumerateUPP) (FUNC))
#define CallNPN_EnumerateProc(FUNC, ARG1, ARG2, ARG3, ARG4) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4))
/* NPN_PluginThreadAsyncCall */
typedef void (*NP_LOADDS NPN_PluginThreadAsyncCallUPP) (NPP instance, void (*func) (void *),
void *userData);
#define NewNPN_PluginThreadAsyncCallProc(FUNC) \
((NPN_PluginThreadAsyncCallUPP) (FUNC))
#define CallNPN_PluginThreadAsyncCallProc(FUNC, ARG1, ARG2, ARG3) \
(*(FUNC))((ARG1), (ARG2), (ARG3))
/* NPN_Construct */
typedef bool(*NP_LOADDS NPN_ConstructUPP) (NPP npp, NPObject * obj, const NPVariant * args,
uint32_t argCount, NPVariant * result);
#define NewNPN_ConstructProc(FUNC) \
((NPN_ConstructUPP) (FUNC))
#define CallNPN_ConstructProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \
(*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5))
/******************************************************************************************
* The actual plugin function table definitions
*******************************************************************************************/
#ifdef DISABLE_THIS
typedef struct _NPPluginFuncs {
uint16_t size;
uint16_t version;
NPP_NewUPP newp;
NPP_DestroyUPP destroy;
NPP_SetWindowUPP setwindow;
NPP_NewStreamUPP newstream;
NPP_DestroyStreamUPP destroystream;
NPP_StreamAsFileUPP asfile;
NPP_WriteReadyUPP writeready;
NPP_WriteUPP write;
NPP_PrintUPP print;
NPP_HandleEventUPP event;
NPP_URLNotifyUPP urlnotify;
JRIGlobalRef javaClass;
NPP_GetValueUPP getvalue;
NPP_SetValueUPP setvalue;
} NPPluginFuncs;
typedef struct _NPNetscapeFuncs {
uint16_t size;
uint16_t version;
NPN_GetURLUPP geturl;
NPN_PostURLUPP posturl;
NPN_RequestReadUPP requestread;
NPN_NewStreamUPP newstream;
NPN_WriteUPP write;
NPN_DestroyStreamUPP destroystream;
NPN_StatusUPP status;
NPN_UserAgentUPP uagent;
NPN_MemAllocUPP memalloc;
NPN_MemFreeUPP memfree;
NPN_MemFlushUPP memflush;
NPN_ReloadPluginsUPP reloadplugins;
NPN_GetJavaEnvUPP getJavaEnv;
NPN_GetJavaPeerUPP getJavaPeer;
NPN_GetURLNotifyUPP geturlnotify;
NPN_PostURLNotifyUPP posturlnotify;
NPN_GetValueUPP getvalue;
NPN_SetValueUPP setvalue;
NPN_InvalidateRectUPP invalidaterect;
NPN_InvalidateRegionUPP invalidateregion;
NPN_ForceRedrawUPP forceredraw;
NPN_GetStringIdentifierUPP getstringidentifier;
NPN_GetStringIdentifiersUPP getstringidentifiers;
NPN_GetIntIdentifierUPP getintidentifier;
NPN_IdentifierIsStringUPP identifierisstring;
NPN_UTF8FromIdentifierUPP utf8fromidentifier;
NPN_IntFromIdentifierUPP intfromidentifier;
NPN_CreateObjectUPP createobject;
NPN_RetainObjectUPP retainobject;
NPN_ReleaseObjectUPP releaseobject;
NPN_InvokeUPP invoke;
NPN_InvokeDefaultUPP invokeDefault;
NPN_EvaluateUPP evaluate;
NPN_GetPropertyUPP getproperty;
NPN_SetPropertyUPP setproperty;
NPN_RemovePropertyUPP removeproperty;
NPN_HasPropertyUPP hasproperty;
NPN_HasMethodUPP hasmethod;
NPN_ReleaseVariantValueUPP releasevariantvalue;
NPN_SetExceptionUPP setexception;
NPN_PushPopupsEnabledStateUPP pushpopupsenabledstate;
NPN_PopPopupsEnabledStateUPP poppopupsenabledstate;
// NPN_EnumerateUPP enumerate;
// NPN_PluginThreadAsyncCallUPP pluginthreadasynccall;
// NPN_ConstructUPP construct;
} NPNetscapeFuncs;
#endif
#ifdef XP_MACOSX
/******************************************************************************************
* Mac platform-specific plugin glue stuff
*******************************************************************************************/
/*
* Main entry point of the plugin.
* This routine will be called when the plugin is loaded. The function
* tables are passed in and the plugin fills in the NPPluginFuncs table
* and NPPShutdownUPP for Netscape's use.
*/
typedef NPError(*NP_LOADDS NPP_MainEntryUPP) (NPNetscapeFuncs *, NPPluginFuncs *,
NPP_ShutdownUPP *);
#define NewNPP_MainEntryProc(FUNC) \
((NPP_MainEntryUPP) (FUNC))
#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \
(*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP))
/*
* Mac OS X version(s) of NP_GetMIMEDescription(const char *)
* These can be called to retreive MIME information from the plugin dynamically
*
* Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
* to get mime info from the plugin only on OSX and may not be supported
* in furture version -- use NP_GetMIMEDescription instead
*/
enum {
kBPSupportedMIMETypesStructVers_1 = 1
};
typedef struct _BPSupportedMIMETypes {
Sint32_t structVersion; /* struct version */
Handle typeStrings; /* STR# formated handle, allocated by plug-in */
Handle infoStrings; /* STR# formated handle, allocated by plug-in */
} BPSupportedMIMETypes;
OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes * mimeInfo, Uint32_t flags);
/* NP_GetMIMEDescription */
#define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
typedef const char *(*NP_LOADDS NP_GetMIMEDescriptionUPP) ();
#define NewNP_GetMIMEDescEntryProc(FUNC) \
((NP_GetMIMEDescriptionUPP) (FUNC))
#define CallNP_GetMIMEDescEntryProc(FUNC) \
(*(FUNC))()
/* BP_GetSupportedMIMETypes */
typedef OSErr(*NP_LOADDS BP_GetSupportedMIMETypesUPP) (BPSupportedMIMETypes *, Uint32_t);
#define NewBP_GetSupportedMIMETypesEntryProc(FUNC) \
((BP_GetSupportedMIMETypesUPP) (FUNC))
#define CallBP_GetMIMEDescEntryProc(FUNC, mimeInfo, flags) \
(*(FUNC))((mimeInfo), (flags))
#endif /* XP_MACOSX */
#if defined(_WINDOWS)
#define OSCALL WINAPI
#else
#if defined(__OS2__)
#define OSCALL _System
#else
#define OSCALL
#endif
#endif
#if defined(XP_UNIX)
/* GCC 3.3 and later support the visibility attribute. */
#if defined(__GNUC__) && \
((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
#define NP_VISIBILITY_DEFAULT __attribute__((visibility("default")))
#else
#define NP_VISIBILITY_DEFAULT
#endif
#define NP_EXPORT(__type) NP_VISIBILITY_DEFAULT __type
#endif
#if defined( _WINDOWS ) || defined (__OS2__)
#ifdef __cplusplus
extern "C" {
#endif
/* plugin meta member functions */
#if defined(__OS2__)
typedef struct _NPPluginData { /* Alternate OS2 Plugin interface */
char *pMimeTypes;
char *pFileExtents;
char *pFileOpenTemplate;
char *pProductName;
char *pProductDescription;
unsigned long dwProductVersionMS;
unsigned long dwProductVersionLS;
} NPPluginData;
NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData);
#endif
NPError OSCALL NP_GetEntryPoints(NPPluginFuncs * pFuncs);
NPError OSCALL NP_Initialize(NPNetscapeFuncs * pFuncs);
NPError OSCALL NP_Shutdown();
#ifdef NPAPI_USE_CONSTCHARS
const char *NP_GetMIMEDescription();
#else
char *NP_GetMIMEDescription();
#endif
#ifdef __cplusplus
}
#endif
#endif /* _WINDOWS || __OS2__ */
#if defined(__OS2__)
#pragma pack()
#endif
#ifdef XP_UNIX
#ifdef __cplusplus
extern "C" {
#endif
/* plugin meta member functions */
#ifdef NPAPI_USE_CONSTCHARS
NP_EXPORT(const char *) NP_GetMIMEDescription(void);
#else
NP_EXPORT(char *) NP_GetMIMEDescription(void);
#endif
NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs *, NPPluginFuncs *);
NP_EXPORT(NPError) NP_Shutdown(void);
NP_EXPORT(NPError) NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
#ifdef __cplusplus
}
#endif
#endif /* XP_UNIX */
#endif /* _NPUPP_H_ */
gecko-mediaplayer-1.0.8/src/memmem_compat.cpp 0000644 0001750 0001750 00000010520 12007254567 016144 0000000 0000000 /* This file implements memmem, a function to find the first occurrence
of the contents of a memory area in another memory area.
Copyright (C) 2003 Martin Dickopp
This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this file; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335,
USA. */
#include
#include
/* This function implements the Boyer-Moore algorithm.
It is assumed that chars have eight bits. */
void *memmem_compat(const void *haystack, const size_t haystack_len,
const void *needle, const size_t needle_len)
{
const unsigned char *const haystack_endptr = (const unsigned char *) haystack + haystack_len;
const unsigned char *const needle_endptr = (const unsigned char *) needle + needle_len;
const unsigned char *haystack_shifting_ptr;
size_t *shift_good_suffix;
size_t shift_last_occurrence[256];
if (needle_len > haystack_len)
return 0;
haystack_shifting_ptr = (const unsigned char *) haystack + needle_len;
/* Compute good suffix function. */
shift_good_suffix = (size_t *) malloc(2 * needle_len * sizeof *shift_good_suffix);
if (shift_good_suffix != 0) {
const unsigned char *needle_ptr;
size_t i, j;
shift_good_suffix[0] = 0;
needle_ptr = (const unsigned char *) needle + 1;
for (i = 1, j = 0; i < needle_len; ++i) {
while (j > 0 && ((const unsigned char *) needle)[j] != *needle_ptr)
j = shift_good_suffix[j - 1];
if (((const unsigned char *) needle)[j] == *needle_ptr)
++j;
shift_good_suffix[i] = j;
++needle_ptr;
}
shift_good_suffix[needle_len] = 0;
needle_ptr = (const unsigned char *) needle + needle_len - 1;
for (i = 1, j = 0; i < needle_len; ++i) {
--needle_ptr;
while (j > 0 && ((const unsigned char *) needle)[needle_len - 1 - j] != *needle_ptr)
j = shift_good_suffix[needle_len - 1 + j];
if (((const unsigned char *) needle)[needle_len - 1 - j] == *needle_ptr)
++j;
shift_good_suffix[needle_len + i] = j;
}
for (i = 0; i < needle_len; ++i)
shift_good_suffix[i] = needle_len - shift_good_suffix[i];
for (i = 0; i < needle_len; ++i) {
j = needle_len - 1 - shift_good_suffix[needle_len + i];
if (shift_good_suffix[j] > i + 1 - shift_good_suffix[needle_len + i])
shift_good_suffix[j] = i + 1 - shift_good_suffix[needle_len + i];
}
}
/* Compute last occurence function. */
{
const unsigned char *needle_ptr = (const unsigned char *) needle;
size_t i;
for (i = 0; i < 256; ++i)
shift_last_occurrence[i] = 0;
for (i = 0; i < needle_len; ++i)
shift_last_occurrence[*needle_ptr++] = i + 1;
}
/* Matching algorithm. */
while (haystack_shifting_ptr <= haystack_endptr) {
const unsigned char *haystack_ptr = haystack_shifting_ptr;
const unsigned char *needle_ptr = needle_endptr;
size_t len = needle_len;
while (len > 0 && *--haystack_ptr == *--needle_ptr)
--len;
if (len == 0) {
if (shift_good_suffix != 0)
free(shift_good_suffix);
return (void *) haystack_ptr;
}
{
const size_t shift1 = shift_good_suffix != 0 ? shift_good_suffix[len - 1] : 1;
const size_t shift2 = (len > shift_last_occurrence[*haystack_ptr]
? len - shift_last_occurrence[*haystack_ptr] : 1);
haystack_shifting_ptr += shift1 > shift2 ? shift1 : shift2;
}
}
if (shift_good_suffix != 0)
free(shift_good_suffix);
return 0;
}
gecko-mediaplayer-1.0.8/src/plugin_types_wmp.cpp 0000664 0001750 0001750 00000010654 12007254567 016743 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plugin_types.h"
gchar *GetMIMEDescription()
{
gchar MimeTypes[4000];
GmPrefStore *store;
gboolean wmp_disabled = FALSE;
g_type_init();
store = gm_pref_store_new("gecko-mediaplayer");
if (store != NULL) {
wmp_disabled = gm_pref_store_get_boolean(store, DISABLE_WMP);
gm_pref_store_free(store);
}
if (wmp_disabled) {
return NULL;
} else {
g_strlcpy(MimeTypes,
"application/asx:*:Media Files;"
"video/x-ms-asf-plugin:*:Media Files;"
"video/x-msvideo:avi,*:AVI;"
"video/msvideo:avi,*:AVI;"
"application/x-mplayer2:*:Media Files;"
"video/x-mplayer2:*:Media Files;"
"application/x-ms-wmv:wmv,*:Microsoft WMV video;"
"video/x-ms-asf:asf,asx,*:Media Files;"
"video/x-ms-asx:asx,*:Media Files;"
"video/x-ms-wm:wm,*:Media Files;"
"video/x-ms-wmv:wmv,*:Microsoft WMV video;"
"audio/x-ms-wmv:wmv,*:Windows Media;"
"video/x-ms-wmp:wmp,*:Windows Media;"
"application/x-ms-wmp:wmp,*:Windows Media;"
"video/x-ms-wvx:wvx,*:Windows Media;"
"audio/x-ms-wax:wax,*:Windows Media;"
"audio/x-ms-wma:wma,*:Windows Media;"
"application/x-drm-v2:asx,*:Windows Media;"
"audio/wav:wav,*:Microsoft wave file;"
"audio/x-wav:wav,*:Microsoft wave file;", sizeof(MimeTypes));
return g_strdup(MimeTypes);
}
}
NPError PluginGetValue(NPPVariable variable, void *value)
{
NPError err = NPERR_NO_ERROR;
// some sites use this description to figure out what formats can be played. So we have to make sure the
// description matches the features
if (variable == NPPVpluginNameString) {
*((const char **) value) = "Windows Media Player Plug-in";
}
if (variable == NPPVpluginDescriptionString) {
*((const char **) value) =
"Gecko Media Player "
VERSION
"
Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer";
}
if (variable == NPPVpluginNeedsXEmbed) {
*((bool *) value) = TRUE;
}
if ((variable != NPPVpluginNameString)
&& (variable != NPPVpluginDescriptionString)
&& (variable != NPPVpluginNeedsXEmbed)) {
err = NPERR_INVALID_PARAM;
}
return err;
}
void pluginSpecific(CPlugin * instance)
{
instance->quicktime_emulation = FALSE;
}
gecko-mediaplayer-1.0.8/src/plugin_list.h 0000664 0001750 0001750 00000011423 12021477073 015322 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _PLUGIN_LIST_H
#define _PLUGIN_LIST_H
#include
#include
#include
#include
#include "memmem_compat.h"
#include
typedef struct _ListItem {
gchar src[4096];
gchar local[1024];
gchar path[1024];
gint id;
gint hrefid;
gint controlid;
gboolean cancelled;
gboolean playerready;
gboolean newwindow;
gboolean streaming;
gboolean requested;
gboolean retrieved;
gboolean oktoplay;
gboolean queuedtoplay;
gboolean play;
gboolean played;
gboolean opened;
gboolean playlist;
guint mediasize;
gint localsize;
gint lastsize;
FILE *localfp;
gboolean loop; // TRUE if we should loop
gint loopcount; // 0 - loop done, -1 loop forever
gint bitrate;
gint bitrate_requests;
void *plugin;
} ListItem;
void asx_start_element(GMarkupParseContext * context,
const gchar * element_name,
const gchar ** attribute_names,
const gchar ** attribute_values, gpointer user_data, GError ** error);
void asx_end_element(GMarkupParseContext * context,
const gchar * element_name, gpointer user_data, GError ** error);
void element_text(GMarkupParseContext * context,
const gchar * text, gsize text_len, gpointer user_data, GError ** error);
static const GMarkupParser asx_parser = {
asx_start_element,
asx_end_element,
NULL, //element_text,
NULL,
NULL,
};
void qml_start_element(GMarkupParseContext * context,
const gchar * element_name,
const gchar ** attribute_names,
const gchar ** attribute_values, gpointer user_data, GError ** error);
static const GMarkupParser qml_parser = {
qml_start_element,
NULL,
NULL,
NULL,
NULL,
};
ListItem *list_find(GList * list, gchar * url);
ListItem *list_find_by_id(GList * list, gint id);
ListItem *list_find_by_controlid(GList * list, gint id);
void list_mark_controlid_ready(GList * list, gint id);
void list_mark_controlid_cancelled(GList * list, gint id, gboolean cancelled);
void list_mark_id_played(GList * list, gint id);
ListItem *list_find_next_playable(GList * list);
ListItem *list_find_next_playable_after_listitem(GList * list, ListItem * find);
ListItem *list_find_first_playable(GList * list);
void list_qualify_url(GList * list, gchar * page_url);
GList *list_clear(GList * list);
void list_dump(GList * list);
GList *list_parse_qt(GList * list, ListItem * item, gboolean detect_only);
GList *list_parse_qt2(GList * list, ListItem * item, gboolean detect_only);
GList *list_parse_asx(GList * list, ListItem * item, gboolean detect_only);
GList *list_parse_qml(GList * list, ListItem * item, gboolean detect_only); // Quick Time Media Link
GList *list_parse_ram(GList * list, ListItem * item, gboolean detect_only); // Real Audio Playlist
gboolean list_item_opened(GList * list);
#endif // _PLUGIN_LIST_H
gecko-mediaplayer-1.0.8/src/Makefile.am 0000664 0001750 0001750 00000004444 11701414107 014652 0000000 0000000 ## Process this file with automake to produce Makefile.in
## Created by Anjuta
SUBDIRS =
DEFINES = -DMOZILLA_STRICT_API -DXP_UNIX
INCLUDES = \
-fPIC \
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
$(GECKO_CFLAGS) \
$(GLIB_CFLAGS) \
$(GMLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(DBUS_CFLAGS) \
$(DEFINES) \
$(CURL_DEFINES) \
$(CURL_CFLAGS)
AM_CFLAGS =\
-Wall \
-g
COMMONCODE = \
../config.h \
plugin.cpp \
memmem_compat.h \
memmem_compat.cpp \
plugin.h \
plugin_list.h \
plugin_list.cpp \
plugin_types.h \
plugin_setup.h \
plugin_setup.cpp \
plugin_dbus.h \
plugin_dbus.cpp \
np_entry.cpp \
npn_gate.cpp \
npp_gate.cpp \
npupp.h
install_libexecdir = $(plugindir)
install_libexec_PROGRAMS = \
gecko-mediaplayer.so \
gecko-mediaplayer-qt.so \
gecko-mediaplayer-wmp.so \
gecko-mediaplayer-rm.so \
gecko-mediaplayer-dvx.so
gecko_mediaplayer_so_SOURCES = \
plugin_types_std.cpp \
$(COMMONCODE)
gecko_mediaplayer_so_CFLAGS = -fPIC
gecko_mediaplayer_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
gecko_mediaplayer_qt_so_SOURCES = \
plugin_types_qt.cpp \
$(COMMONCODE)
gecko_mediaplayer_qt_so_CFLAGS = -fPIC
gecko_mediaplayer_qt_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_qt_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
gecko_mediaplayer_wmp_so_SOURCES = \
plugin_types_wmp.cpp \
$(COMMONCODE)
gecko_mediaplayer_wmp_so_CFLAGS = -fPIC
gecko_mediaplayer_wmp_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_wmp_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
gecko_mediaplayer_dvx_so_SOURCES = \
plugin_types_dvx.cpp \
$(COMMONCODE)
gecko_mediaplayer_dvx_so_CFLAGS = -fPIC
gecko_mediaplayer_dvx_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_dvx_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
gecko_mediaplayer_rm_so_SOURCES = \
plugin_types_rm.cpp \
$(COMMONCODE)
gecko_mediaplayer_rm_so_CFLAGS = -fPIC
gecko_mediaplayer_rm_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_rm_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
indent:
indent -kr -l100 -i4 -nut *.cpp
indent -kr -l100 -i4 -nut *.h
rm *~
gecko-mediaplayer-1.0.8/src/plugin_setup.cpp 0000664 0001750 0001750 00000057424 12021477073 016055 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plugin.h"
#include "plugin_list.h"
#include "plugin_setup.h"
// void new_instance(CPlugin * instance, nsPluginCreateData * parameters)
void new_instance(CPlugin * instance, int16_t argc, char *argn[], char *argv[])
{
int16_t i;
guint j;
gint newwindow = 0;
gint loop = 0;
gboolean autohref = FALSE;
gboolean force_streaming = FALSE;
ListItem *item = NULL;
ListItem *src = NULL;
ListItem *href = NULL;
ListItem *qtsrc = NULL;
gchar *arg[10];
GRand *rand;
gchar *tmp;
//gchar *url;
gchar **parse;
gint width = 0, height = 0;
GError *error;
NPError nperror;
guint32 supportsWindowless = FALSE; // NPBool + padding
gchar *app_name;
if (instance->mode == NP_EMBED) {
/*
printf("argc = %i\n", argc);
for (i = 0; i < argc; i++) {
printf("ARG[%i]: %s = %s\n", i, argn[i], argv[i]);
}
*/
for (i = 0; i < argc; i++) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "ARG[%i]: %s = %s", i, argn[i],
argv[i]);
if (argn[i] == NULL)
continue;
if (g_ascii_strcasecmp(argn[i], "name") == 0) {
instance->name = g_strdup(argv[i]);
}
if (g_ascii_strcasecmp(argn[i], "id") == 0) {
instance->id = g_strdup(argv[i]);
}
if (g_ascii_strcasecmp(argn[i], "console") == 0) {
instance->console = g_strdup(argv[i]);
if (instance->console != NULL) {
for (j = 0; j < strlen(instance->console); j++) {
if (!g_ascii_isalnum(instance->console[j])) {
instance->console[j] = 'a';
}
}
}
}
if (g_ascii_strcasecmp(argn[i], "controls") == 0) {
instance->controls = g_strdup(argv[i]);
}
if (g_ascii_strcasecmp(argn[i], "showcontrols") == 0) {
if (g_ascii_strcasecmp(argv[i], "true") == 0
|| g_ascii_strcasecmp(argv[i], "yes") == 0
|| g_ascii_strcasecmp(argv[i], "1") == 0) {
instance->show_controls = 1;
} else {
instance->show_controls = 0;
}
}
if (g_ascii_strcasecmp(argn[i], "width") == 0) {
sscanf(argv[i], "%i", &width);
}
if (g_ascii_strcasecmp(argn[i], "height") == 0) {
sscanf(argv[i], "%i", &height);
}
if (g_ascii_strcasecmp(argn[i], "style") == 0) {
tmp = g_strrstr(argv[i], "width:");
if (tmp)
sscanf(tmp + strlen("width:"), "%i", &width);
tmp = g_strrstr(argv[i], "height:");
if (tmp)
sscanf(tmp + strlen("height:"), "%i", &height);
gm_log(instance->debug_level, G_LOG_LEVEL_DEBUG, "done with style\n");
}
if (g_ascii_strcasecmp(argn[i], "src") == 0 || g_ascii_strcasecmp(argn[i], "url") == 0) {
item = g_new0(ListItem, 1);
if (g_strrstr(argv[i], "XXmovies.apple.com")) { // tmp disabled, to reenable remove XX
tmp = g_strrstr(argv[i], "movies.");
if (tmp != NULL && strlen(tmp) > strlen("movies.")) {
tmp = tmp + strlen("movies.");
g_snprintf(item->src, 4096, "http://www.%s", tmp);
} else {
g_strlcpy(item->src, argv[i], 4096);
}
} else {
g_strlcpy(item->src, argv[i], 4096);
}
// printf("Item src = %s\n",item->src);
item->streaming = streaming(item->src);
item->play = TRUE;
item->id = instance->nextid++;
instance->playlist = g_list_append(instance->playlist, item);
src = item;
}
if (g_ascii_strcasecmp(argn[i], "filename") == 0) {
item = g_new0(ListItem, 1);
g_strlcpy(item->src, argv[i], 4096);
// printf("Item src = %s\n",item->src);
item->streaming = streaming(item->src);
item->play = TRUE;
item->id = instance->nextid++;
instance->playlist = g_list_append(instance->playlist, item);
src = item;
}
if (g_ascii_strcasecmp(argn[i], "href") == 0) {
item = g_new0(ListItem, 1);
if (g_strrstr(argv[i], "XXmovies.apple.com")) {
tmp = g_strrstr(argv[i], "movies.");
if (tmp != NULL && strlen(tmp) > strlen("movies.")) {
tmp = tmp + strlen("movies.");
g_snprintf(item->src, 4096, "http://www.%s", tmp);
} else {
g_strlcpy(item->src, argv[i], 4096);
}
} else {
g_strlcpy(item->src, argv[i], 4096);
}
// printf("Item href = %s\n",item->src);
item->streaming = streaming(item->src);
item->play = FALSE;
item->id = instance->nextid++;
instance->playlist = g_list_append(instance->playlist, item);
href = item;
}
if (g_ascii_strcasecmp(argn[i], "qtsrc") == 0) {
item = g_new0(ListItem, 1);
g_strlcpy(item->src, argv[i], 4096);
item->streaming = streaming(item->src);
item->play = TRUE;
item->id = instance->nextid++;
instance->playlist = g_list_append(instance->playlist, item);
qtsrc = item;
}
if (g_ascii_strcasecmp(argn[i], "file") == 0) {
item = g_new0(ListItem, 1);
g_strlcpy(item->local, argv[i], 1024);
// printf("Item href = %s\n",item->src);
item->streaming = streaming(item->src);
item->play = TRUE;
item->id = instance->nextid++;
instance->playlist = g_list_append(instance->playlist, item);
src = item;
}
if (g_ascii_strcasecmp(argn[i], "target") == 0) {
if (g_ascii_strcasecmp(argv[i], "quicktimeplayer") == 0) {
newwindow = TRUE;
} else {
item = g_new0(ListItem, 1);
g_strlcpy(item->src, argv[i], 4096);
// printf("Item href = %s\n",item->src);
item->streaming = streaming(item->src);
item->play = FALSE;
item->id = instance->nextid++;
instance->playlist = g_list_append(instance->playlist, item);
src = item;
instance->show_controls = 0;
}
}
if (g_ascii_strcasecmp(argn[i], "hidden") == 0) {
if (g_ascii_strcasecmp(argv[i], "true") == 0
|| g_ascii_strcasecmp(argv[i], "yes") == 0
|| g_ascii_strcasecmp(argv[i], "1") == 0) {
instance->hidden = TRUE;
} else {
instance->hidden = FALSE;
}
}
if (g_ascii_strcasecmp(argn[i], "tv_device") == 0) {
instance->tv_device = g_strdup_printf("%s", argv[i]);
}
if (g_ascii_strcasecmp(argn[i], "tv_driver") == 0) {
instance->tv_driver = g_strdup_printf("%s", argv[i]);
}
if (g_ascii_strcasecmp(argn[i], "tv_input") == 0) {
instance->tv_input = g_strdup_printf("%s", argv[i]);
}
if (g_ascii_strcasecmp(argn[i], "tv_width") == 0) {
sscanf(argv[i], "%i", &(instance->tv_width));
}
if (g_ascii_strcasecmp(argn[i], "tv_height") == 0) {
sscanf(argv[i], "%i", &(instance->tv_height));
}
if (g_ascii_strcasecmp(argn[i], "autohref") == 0) {
if (g_ascii_strcasecmp(argv[i], "true") == 0
|| g_ascii_strcasecmp(argv[i], "yes") == 0
|| g_ascii_strcasecmp(argv[i], "autohref") == 0
|| g_ascii_strcasecmp(argv[i], "1") == 0) {
autohref = TRUE;
} else {
autohref = FALSE;
}
}
if (g_ascii_strcasecmp(argn[i], "data") == 0) {
// autohref = TRUE;
}
if ((g_ascii_strcasecmp(argn[i], "autoplay") == 0)
|| (g_ascii_strcasecmp(argn[i], "autostart") == 0)) {
if (g_ascii_strcasecmp(argv[i], "false") == 0
|| g_ascii_strcasecmp(argv[i], "no") == 0
|| g_ascii_strcasecmp(argv[i], "0") == 0) {
instance->autostart = 0;
} else {
instance->autostart = 1;
}
}
if (g_ascii_strcasecmp(argn[i], "enablecontextmenu") == 0) {
if (g_ascii_strcasecmp(argv[i], "false") == 0
|| g_ascii_strcasecmp(argv[i], "no") == 0
|| g_ascii_strcasecmp(argv[i], "0") == 0) {
instance->disable_context_menu = TRUE;
} else {
instance->disable_context_menu = FALSE;
}
}
if (g_ascii_strcasecmp(argn[i], "enablefullscreen") == 0) {
if (g_ascii_strcasecmp(argv[i], "false") == 0
|| g_ascii_strcasecmp(argv[i], "no") == 0
|| g_ascii_strcasecmp(argv[i], "0") == 0) {
instance->disable_fullscreen = TRUE;
} else {
instance->disable_fullscreen = FALSE;
}
}
if ((g_ascii_strcasecmp(argn[i], "loop") == 0)
|| (g_ascii_strcasecmp(argn[i], "autorewind")
== 0)
|| (g_ascii_strcasecmp(argn[i], "repeat") == 0)) {
if (g_ascii_strcasecmp(argv[i], "true") == 0
|| g_ascii_strcasecmp(argv[i], "yes") == 0
|| g_ascii_strcasecmp(argv[i], "infinite") == 0) {
loop = -1;
} else if (g_ascii_isdigit((int) *(argv[i]))) {
sscanf(argv[i], "%i", &loop);
} else {
loop = 0; // loop disabled
}
}
if (g_ascii_strcasecmp(argn[i], "nocache") == 0
|| g_ascii_strcasecmp(argn[i], "qtsrcdontusebrowser") == 0) {
if (g_ascii_strcasecmp(argv[i], "true") == 0
|| g_ascii_strcasecmp(argv[i], "yes") == 0
|| g_ascii_strcasecmp(argv[i], "1") == 0
|| g_ascii_strcasecmp(argv[i], "") == 0 || argv[i] == NULL) {
force_streaming = TRUE;
} else {
force_streaming = FALSE;
}
}
if (g_ascii_strcasecmp(argn[i], "postdomevents") == 0) {
if (g_ascii_strcasecmp(argv[i], "true") == 0
|| g_ascii_strcasecmp(argv[i], "yes") == 0
|| g_ascii_strcasecmp(argv[i], "1") == 0) {
instance->post_dom_events = TRUE;
} else {
instance->post_dom_events = FALSE;
}
}
if (g_ascii_strcasecmp(argn[i], "onmediacomplete") == 0
|| g_ascii_strcasecmp(argn[i], "onendofstream") == 0) {
if (g_ascii_strncasecmp(argv[i], "javascript:", 11) == 0) {
instance->event_mediacomplete = g_strdup_printf("%s", argv[i]);
} else {
instance->event_mediacomplete = g_strdup_printf("javascript:%s", argv[i]);
}
}
if (g_ascii_strcasecmp(argn[i], "ondestroy") == 0) {
if (g_ascii_strncasecmp(argv[i], "javascript:", 11) == 0) {
instance->event_destroy = g_strdup_printf("%s", argv[i]);
} else {
instance->event_destroy = g_strdup_printf("javascript:%s", argv[i]);
}
}
if (g_ascii_strcasecmp(argn[i], "onmouseover") == 0) {
if (g_ascii_strncasecmp(argv[i], "javascript:", 11) == 0) {
instance->event_enterwindow = g_strdup_printf("%s", argv[i]);
} else {
instance->event_enterwindow = g_strdup_printf("javascript:%s", argv[i]);
}
}
if (g_ascii_strcasecmp(argn[i], "onmouseout") == 0) {
if (g_ascii_strncasecmp(argv[i], "javascript:", 11) == 0) {
instance->event_leavewindow = g_strdup_printf("%s", argv[i]);
} else {
instance->event_leavewindow = g_strdup_printf("javascript:%s", argv[i]);
}
}
if (g_ascii_strcasecmp(argn[i], "onclick") == 0) {
if (g_ascii_strncasecmp(argv[i], "javascript:", 11) == 0) {
instance->event_mouseclicked = g_strdup_printf("%s", argv[i]);
} else {
instance->event_mouseclicked = g_strdup_printf("javascript:%s", argv[i]);
}
}
if (g_ascii_strcasecmp(argn[i], "onmousedown") == 0) {
parse = g_strsplit(argv[i], "(", 0);
if (g_ascii_strncasecmp(parse[0], "javascript:", 11) == 0) {
instance->event_mousedown = g_strdup_printf("%s", parse[0]);
} else {
instance->event_mousedown = g_strdup_printf("javascript:%s", parse[0]);
}
g_strfreev(parse);
}
if (g_ascii_strcasecmp(argn[i], "onmouseup") == 0) {
parse = g_strsplit(argv[i], "(", 0);
if (g_ascii_strncasecmp(parse[0], "javascript:", 11) == 0) {
instance->event_mouseup = g_strdup_printf("%s", parse[0]);
} else {
instance->event_mouseup = g_strdup_printf("javascript:%s", parse[0]);
}
g_strfreev(parse);
}
if (g_ascii_strcasecmp(argn[i], "debug") == 0) {
if (g_ascii_strcasecmp(argv[i], "true") == 0
|| g_ascii_strcasecmp(argv[i], "yes") == 0
|| g_ascii_strcasecmp(argv[i], "1") == 0) {
instance->debug = TRUE;
} else {
instance->debug = FALSE;
}
}
if (g_ascii_strcasecmp(argn[i], "windowless") == 0) {
if (g_ascii_strcasecmp(argv[i], "true") == 0
|| g_ascii_strcasecmp(argv[i], "yes") == 0
|| g_ascii_strcasecmp(argv[i], "1") == 0) {
instance->windowless = TRUE;
} else {
instance->windowless = FALSE;
}
}
if (g_ascii_strncasecmp(argn[i], "qtnext", 6) == 0) {
parse = g_strsplit_set(argv[i], "<>", 0);
if (parse[1] != NULL) {
item = g_new0(ListItem, 1);
tmp = g_strrstr(src->src, "/");
if (tmp) {
g_strlcpy(item->src, src->src, 1024);
tmp = g_strrstr(item->src, "/");
tmp[1] = '\0';
g_strlcat(item->src, parse[1], 4096);
} else {
g_strlcpy(item->src, parse[1], 4096);
}
item->streaming = streaming(item->src);
item->play = TRUE;
item->id = instance->nextid++;
instance->playlist = g_list_append(instance->playlist, item);
}
g_strfreev(parse);
}
};
} else {
// printf("Non-Embed Mode\n");
for (i = 0; i < argc; i++) {
if (argn[i] == NULL)
continue;
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "ARG: %s = %s\n", argn[i], argv[i]);
if (g_ascii_strcasecmp(argn[i], "src") == 0) {
item = g_new0(ListItem, 1);
if (g_strrstr(argv[i], "XXmovies.apple.com")) { // tmp disabled, to reenable remove XX
tmp = g_strrstr(argv[i], "movies.");
if (tmp != NULL && strlen(tmp) > strlen("movies.")) {
tmp = tmp + strlen("movies.");
g_snprintf(item->src, 4096, "http://www.%s", tmp);
} else {
g_strlcpy(item->src, argv[i], 4096);
}
} else {
g_strlcpy(item->src, argv[i], 4096);
}
item->streaming = streaming(item->src);
gm_log(instance->debug_level, G_LOG_LEVEL_DEBUG, "this should match %s\n",
item->src);
item->play = TRUE;
item->id = instance->nextid++;
instance->playlist = g_list_append(instance->playlist, item);
src = item;
}
}
}
nperror = NPN_GetValue(instance->mInstance, (NPNVariable) 17 /* NPNVSupportsWindowless */ ,
&supportsWindowless);
supportsWindowless = (nperror == NPERR_NO_ERROR) && supportsWindowless;
if (instance->windowless) {
if (supportsWindowless) {
// NPN_SetValue (instance->mInstance, NPPVpluginWindowBool, (void *) FALSE);
// NPN_SetValue (instance->mInstance, NPPVpluginTransparentBool, (void *) TRUE);
} else {
instance->windowless = FALSE;
}
}
if (qtsrc != NULL) {
src->play = FALSE;
}
if (src != NULL) {
if (loop != 0) {
src->loop = TRUE;
src->loopcount = loop;
} else {
loop = FALSE;
}
} else {
// Having this event fire creates several instances of gmp at some websites
// postPlayStateChange(instance->mInstance, STATE_TRANSITIONING);
}
// link up src to href objects by id
if (href != NULL && src != NULL) {
src->hrefid = href->id;
}
// if target is set, set it on the href
if (href != NULL) {
href->newwindow = newwindow;
}
if (item == NULL) {
item = g_new0(ListItem, 1);
item->play = FALSE;
item->id = instance->nextid++;
item->streaming = FALSE;
}
#ifdef DISABLE_CACHE
item->streaming = TRUE;
#else
if (force_streaming) {
item->streaming = TRUE;
src->streaming = TRUE;
if (qtsrc)
qtsrc->streaming = TRUE;
}
list_qualify_url(instance->playlist, instance->page_url);
// if (g_ascii_strcasecmp(instance->mimetype,"video/x-flv") == 0) {
// item->streaming = TRUE;
// }
#endif
// list_dump(instance->playlist);
if (instance->hidden == TRUE || ((width == 0 || height == 0) && instance->mode != NP_FULL)) {
if (item->streaming) {
open_location(instance, item, FALSE);
item->requested = 1;
} else {
item->requested = 1;
instance->GetURLNotify(instance->mInstance, item->src, NULL, item);
}
}
if (autohref == TRUE) {
src->play = FALSE;
href->play = TRUE;
i = 0;
// generate a random controlid
rand = g_rand_new();
href->controlid = g_rand_int_range(rand, 0, 65535);
// printf("autohref controlid = %i\n", href->controlid);
g_rand_free(rand);
tmp = g_strdup_printf("/control/%i", href->controlid);
g_strlcpy(href->path, tmp, 1024);
g_free(tmp);
//list_dump(instance->playlist);
app_name = NULL;
if (instance->player_backend != NULL) {
app_name = g_find_program_in_path(instance->player_backend);
}
if (app_name == NULL) {
app_name = g_find_program_in_path("gnome-mplayer");
if (app_name == NULL)
app_name = g_find_program_in_path("gnome-mplayer-minimal");
}
arg[i++] = g_strdup(app_name);
arg[i++] = g_strdup_printf("--controlid=%i", href->controlid);
arg[i] = NULL;
error = NULL;
if (g_spawn_async(NULL, arg, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error) == FALSE) {
gm_log(TRUE, G_LOG_LEVEL_INFO, "Unable to launch: %s\n", error->message);
g_error_free(error);
error = NULL;
}
instance->GetURLNotify(instance->mInstance, href->src, NULL, href);
g_free(app_name);
}
}
gboolean streaming(gchar * url)
{
gboolean ret = FALSE;
char *p;
if (g_ascii_strncasecmp(url, "mms://", 6) == 0)
ret = TRUE;
if (g_ascii_strncasecmp(url, "mmst://", 7) == 0)
ret = TRUE;
if (g_ascii_strncasecmp(url, "mmsu://", 7) == 0)
ret = TRUE;
if (g_ascii_strncasecmp(url, "rtsp://", 7) == 0)
ret = TRUE;
if (g_ascii_strncasecmp(url, "rtp://", 6) == 0)
ret = TRUE;
if (g_ascii_strncasecmp(url, "tv://", 5) == 0)
ret = TRUE;
if (g_ascii_strncasecmp(url, "dvd://", 6) == 0)
ret = TRUE;
if (g_ascii_strncasecmp(url, "udp://", 6) == 0)
ret = TRUE;
if (g_strrstr(url, ".m3u") != NULL)
ret = TRUE;
if (g_strrstr(url, "stream") != NULL) {
if (g_strrstr(url, "http://") == NULL)
ret = TRUE;
}
if (g_strrstr(url, "MSWMExt=.asf") != NULL)
ret = TRUE;
if (ret == FALSE && g_ascii_strncasecmp(url, "file://", 7) == 0) {
p = g_filename_from_uri(url, NULL, NULL);
if (p != NULL) {
if (g_file_test(p, G_FILE_TEST_EXISTS)) {
g_strlcpy(url, p, 1024);
ret = TRUE;
}
g_free(p);
}
}
return ret;
}
gecko-mediaplayer-1.0.8/src/npp_gate.cpp 0000664 0001750 0001750 00000020433 12007254567 015127 0000000 0000000 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
////////////////////////////////////////////////////////////
//
// Implementation of plugin entry points (NPP_*)
// most are just empty stubs for this particular plugin
//
#include "plugin.h"
#include "plugin_types.h"
#include "plugin_setup.h"
#ifdef HAVE_CONFIG_H
#include
#endif
#ifdef NPAPI_USE_CONSTCHARS
const char *NPP_GetMIMEDescription(void)
{
return GetMIMEDescription();
}
#else
char *NPP_GetMIMEDescription(void)
{
return GetMIMEDescription();
}
#endif
NPError NPP_Initialize(void)
{
return NPERR_NO_ERROR;
}
void NPP_Shutdown(void)
{
}
// here the plugin creates an instance of our CPlugin object which
// will be associated with this newly created plugin instance and
// will do all the neccessary job
NPError NPP_New(NPMIMEType pluginType,
NPP instance,
uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData * saved)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
printf("NPP_New called\n");
CPlugin *pPlugin = new CPlugin(instance);
if (pPlugin == NULL)
return NPERR_OUT_OF_MEMORY_ERROR;
instance->pdata = (void *) pPlugin;
pPlugin->mode = mode;
pPlugin->mimetype = g_strdup(pluginType);
pPlugin->mInstance = instance;
new_instance(pPlugin, argc, argn, argv);
return rv;
}
// here is the place to clean up and destroy the CPlugin object
NPError NPP_Destroy(NPP instance, NPSavedData ** save)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
CPlugin *pPlugin = (CPlugin *) instance->pdata;
if (pPlugin != NULL) {
pPlugin->shut();
delete pPlugin;
}
return rv;
}
// during this call we know when the plugin window is ready or
// is about to be destroyed so we can do some gui specific
// initialization and shutdown
NPError NPP_SetWindow(NPP instance, NPWindow * pNPWindow)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
if (pNPWindow == NULL)
return NPERR_GENERIC_ERROR;
CPlugin *pPlugin = (CPlugin *) instance->pdata;
if (pPlugin == NULL)
return NPERR_GENERIC_ERROR;
// window just created
if (!pPlugin->isInitialized() && (pNPWindow->window != NULL)) {
if (!pPlugin->init(pNPWindow)) {
delete pPlugin;
pPlugin = NULL;
return NPERR_MODULE_LOAD_FAILED_ERROR;
}
}
// window goes away
if ((pNPWindow->window == NULL) && pPlugin->isInitialized())
return NPERR_NO_ERROR;
// window resized
if (pPlugin->isInitialized() && (pNPWindow->window != NULL)) {
printf("Window resized\n");
pPlugin->SetWindow(pNPWindow);
return NPERR_NO_ERROR;
}
// this should not happen, nothing to do
if ((pNPWindow->window == NULL) && !pPlugin->isInitialized())
return NPERR_NO_ERROR;
return rv;
}
// ==============================
// ! Scriptability related code !
// ==============================
//
// here the plugin is asked by Mozilla to tell if it is scriptable
// we should return a valid interface id and a pointer to
// nsScriptablePeer interface which we should have implemented
// and which should be defined in the corressponding *.xpt file
// in the bin/components folder
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
{
NPError rv = NPERR_NO_ERROR;
if (variable == NPPVpluginScriptableNPObject) {
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
CPlugin *plugin = (CPlugin *) instance->pdata;
if (plugin == NULL)
return NPERR_GENERIC_ERROR;
*(NPObject **) value = plugin->GetScriptableObject();
} else {
rv = PluginGetValue(variable, value);
}
return rv;
}
NPError NPP_NewStream(NPP instance,
NPMIMEType type, NPStream * stream, NPBool seekable, uint16_t * stype)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
CPlugin *pPlugin = (CPlugin *) instance->pdata;
if (pPlugin == NULL)
return NPERR_GENERIC_ERROR;
pPlugin->NewStream(type, stream, seekable, stype);
return rv;
}
int32_t NPP_WriteReady(NPP instance, NPStream * stream)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
int32_t rv = 0x0fffffff;
CPlugin *pPlugin = (CPlugin *) instance->pdata;
if (pPlugin == NULL)
return NPERR_GENERIC_ERROR;
rv = pPlugin->WriteReady(stream);
// printf("rv = %i\n",rv);
return rv;
}
int32_t NPP_Write(NPP instance, NPStream * stream, int32_t offset, int32_t len, void *buffer)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
int32_t rv = len;
CPlugin *pPlugin = (CPlugin *) instance->pdata;
if (pPlugin == NULL)
return NPERR_GENERIC_ERROR;
rv = pPlugin->Write(stream, offset, len, buffer);
// printf("rv = %i\n", rv);
return rv;
}
NPError NPP_DestroyStream(NPP instance, NPStream * stream, NPError reason)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
CPlugin *pPlugin = (CPlugin *) instance->pdata;
if (pPlugin == NULL)
return NPERR_GENERIC_ERROR;
pPlugin->DestroyStream(stream, reason);
return rv;
}
void NPP_StreamAsFile(NPP instance, NPStream * stream, const char *fname)
{
if (instance == NULL)
return;
}
void NPP_Print(NPP instance, NPPrint * printInfo)
{
if (instance == NULL)
return;
}
void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyData)
{
if (instance == NULL)
return;
CPlugin *pPlugin = (CPlugin *) instance->pdata;
if (pPlugin == NULL)
return;
pPlugin->URLNotify(url, reason, notifyData);
}
NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
NPError rv = NPERR_NO_ERROR;
return rv;
}
int16_t NPP_HandleEvent(NPP instance, void *event)
{
if (instance == NULL)
return 0;
int16_t rv = 0;
CPlugin *pPlugin = (CPlugin *) instance->pdata;
if (pPlugin)
rv = pPlugin->handleEvent(event);
return rv;
}
/*
jref NPP_GetJavaClass (void)
{
return NULL;
}
*/
NPObject *NPP_GetScriptableInstance(NPP instance)
{
if (!instance)
return 0;
NPObject *npobj = 0;
CPlugin *pPlugin = (CPlugin *) instance->pdata;
if (!pPlugin)
npobj = pPlugin->GetScriptableObject();
return npobj;
}
gecko-mediaplayer-1.0.8/src/memmem_compat.h 0000664 0001750 0001750 00000003666 12007254567 015630 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _MEMMEM_COMPAT_H
#define _MEMMEM_COMPAT_H
void *memmem_compat(const void *haystack, const size_t haystack_len,
const void *needle, const size_t needle_len);
#endif
gecko-mediaplayer-1.0.8/src/plugin_dbus.cpp 0000664 0001750 0001750 00000116274 12021477073 015651 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plugin_dbus.h"
static DBusHandlerResult filter_func(DBusConnection * connection,
DBusMessage * message, void *user_data)
{
const gchar *sender;
const gchar *destination;
int message_type;
gchar *s = NULL;
DBusError error;
// DBusMessage *reply_message;
gchar *path;
CPlugin *instance;
ListItem *item = NULL;
ListItem *fetch_item = NULL;
gchar *arg[10];
gint i;
GRand *rand;
gchar *tmp;
GError *gerror;
gchar *app_name;
message_type = dbus_message_get_type(message);
sender = dbus_message_get_sender(message);
destination = dbus_message_get_destination(message);
/*
printf("path=%s; interface=%s; member=%s; data=%s\n",
dbus_message_get_path(message),
dbus_message_get_interface(message), dbus_message_get_member(message), s);
*/
instance = (CPlugin *) user_data;
path = instance->path;
if (dbus_message_get_path(message) != NULL
&& is_valid_path(instance, dbus_message_get_path(message))) {
//printf("Path matched %s\n", dbus_message_get_path(message));
if (message_type == DBUS_MESSAGE_TYPE_SIGNAL) {
if (g_ascii_strcasecmp(dbus_message_get_member(message), "Ready") == 0) {
dbus_error_init(&error);
if (dbus_message_get_args(message, &error, DBUS_TYPE_INT32, &i, DBUS_TYPE_INVALID)) {
item = list_find_by_controlid(instance->playlist, i);
if (item != NULL) {
list_mark_controlid_ready(instance->playlist, i);
} else {
// printf("Control id not found\n");
}
} else {
dbus_error_free(&error);
}
instance->playerready = TRUE;
// disable this as WMP doesn't do this
// postPlayStateChange(instance->mInstance, STATE_READY);
if (g_strrstr(instance->mimetype, "audio") != NULL) {
instance->cache_size =
request_int_value(instance, item, "GetPluginAudioCacheSize");
} else {
instance->cache_size =
request_int_value(instance, item, "GetPluginVideoCacheSize");
}
if (instance->cache_size == 0) {
item->streaming = 1;
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(dbus_message_get_member(message), "Cancel") == 0) {
dbus_error_init(&error);
if (dbus_message_get_args(message, &error, DBUS_TYPE_INT32, &i, DBUS_TYPE_INVALID)) {
list_mark_controlid_cancelled(instance->playlist, i, TRUE);
} else {
dbus_error_free(&error);
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(dbus_message_get_member(message), "ReloadPlugins") == 0) {
NPN_ReloadPlugins(FALSE);
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(dbus_message_get_member(message), "ListDump") == 0) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "playlist:\n");
list_dump(instance->playlist);
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(dbus_message_get_member(message), "RequestById") == 0) {
dbus_error_init(&error);
if (dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Got id %s\n", s);
item = list_find_by_id(instance->playlist, (gint) g_strtod(s, NULL));
if (item != NULL) {
item->play = TRUE;
item->cancelled = FALSE;
item->retrieved = FALSE;
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "id %s has url of %s\n", s,
item->src);
gm_log(instance->debug_level, G_LOG_LEVEL_INFO,
"id %s has newwindow = %i\n", s, item->newwindow);
if (item->newwindow == 0) {
send_signal_with_boolean(instance, item, "SetShowControls", TRUE);
if (item->streaming) {
send_signal_with_string(instance, item, "Open", item->src);
} else {
item->requested = TRUE;
item->queuedtoplay = TRUE;
instance->GetURLNotify(instance->mInstance, item->src, NULL, item);
}
} else {
i = 0;
// generate a random controlid
rand = g_rand_new();
item->controlid = g_rand_int_range(rand, 0, 65535);
g_rand_free(rand);
tmp = g_strdup_printf("/control/%i", item->controlid);
g_strlcpy(item->path, tmp, 1024);
g_free(tmp);
// list_dump(instance->playlist);
app_name = NULL;
if (instance->player_backend != NULL) {
app_name = g_find_program_in_path(instance->player_backend);
}
if (app_name == NULL) {
app_name = g_find_program_in_path("gnome-mplayer");
if (app_name == NULL)
app_name = g_find_program_in_path("gnome-mplayer-minimal");
}
arg[i++] = g_strdup(app_name);
arg[i++] = g_strdup_printf("--controlid=%i", item->controlid);
arg[i] = NULL;
gerror = NULL;
if (g_spawn_async(NULL, arg, NULL,
G_SPAWN_SEARCH_PATH, NULL, NULL, NULL,
&gerror) == FALSE) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO,
"Unable to launch %s: %s\n", app_name, gerror->message);
g_error_free(gerror);
gerror = NULL;
}
g_free(app_name);
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "requesting %s \n",
item->src);
item->requested = TRUE;
item->queuedtoplay = TRUE;
instance->GetURLNotify(instance->mInstance, item->src, NULL, item);
}
instance->lastopened->played = TRUE;
item->requested = TRUE;
instance->lastopened = item;
}
} else {
dbus_error_free(&error);
}
//list_dump(instance->playlist);
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(dbus_message_get_member(message), "Next") == 0) {
postPlayStateChange(instance->mInstance, STATE_TRANSITIONING);
if (instance->lastopened != NULL && instance->lastopened->loop == FALSE) {
list_mark_id_played(instance->playlist, instance->lastopened->id);
instance->lastopened->played = TRUE;
item = list_find_next_playable(instance->playlist);
} else {
if (instance->lastopened != NULL && instance->lastopened->loop == TRUE) {
if (instance->lastopened->loopcount < 0) {
item = instance->lastopened;
item->played = FALSE;
item->opened = FALSE;
} else if (instance->lastopened->loopcount > 0) {
instance->lastopened->loopcount--;
item = instance->lastopened;
item->played = FALSE;
item->opened = FALSE;
} else {
// listcount = 0
instance->lastopened->loop = FALSE;
item = list_find_next_playable(instance->playlist);
}
}
}
if (item != NULL) {
printf("next item src = %s\n", item->src);
printf("next item local = %s\n", item->local);
printf("next item streaming = %i\n", item->streaming);
} else {
printf("do not know what the next item is\n");
list_dump(instance->playlist);
}
if (item != NULL) {
/*
if (item->newwindow == 0) {
open_location(instance, item, TRUE);
} else {
i = 0;
arg[i++] = g_strdup("gnome-mplayer");
arg[i++] =
g_strdup_printf("--controlid=%i",
instance->controlid);
arg[i++] = g_strdup(item->src);
arg[i] = NULL;
g_spawn_async(NULL, arg, NULL,
G_SPAWN_SEARCH_PATH,
NULL, NULL, NULL, NULL);
item->opened = TRUE;
instance->lastopened = item;
}
*/
if (!item->streaming) {
item->controlid = instance->lastopened->controlid;
g_strlcpy(item->path, instance->lastopened->path, 1024);
item->playerready = instance->lastopened->playerready;
item->newwindow = instance->lastopened->newwindow;
item->cancelled = FALSE;
if (item->retrieved) {
open_location(instance, item, TRUE);
fetch_item =
list_find_next_playable_after_listitem(instance->playlist, item);
if (fetch_item != NULL) {
if (!fetch_item->streaming) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO,
"Getting URL '%s'", fetch_item->src);
fetch_item->requested = TRUE;
instance->GetURLNotify(instance->mInstance, fetch_item->src,
NULL, fetch_item);
}
}
} else {
item->requested = TRUE;
item->queuedtoplay = TRUE;
instance->GetURLNotify(instance->mInstance, item->src, NULL, item);
}
} else {
open_location(instance, item, FALSE);
fetch_item =
list_find_next_playable_after_listitem(instance->playlist, item);
if (fetch_item != NULL) {
if (!fetch_item->streaming) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Getting URL '%s'",
fetch_item->src);
fetch_item->requested = TRUE;
instance->GetURLNotify(instance->mInstance, fetch_item->src, NULL,
fetch_item);
}
}
}
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(dbus_message_get_member(message), "Event") == 0) {
dbus_error_init(&error);
if (dbus_message_get_args
(message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INT32, &i,
DBUS_TYPE_INVALID)) {
// uncomment for event debugging
// printf("Event: %s button %i\n",s,i);
if (g_ascii_strcasecmp(s, "MediaComplete") == 0) {
if (instance->event_mediacomplete != NULL) {
NPN_GetURL(instance->mInstance, instance->event_mediacomplete, NULL);
}
postPlayStateChange(instance->mInstance, STATE_MEDIAENDED);
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "MouseClicked") == 0) {
if (instance->event_mouseclicked != NULL) {
NPN_GetURL(instance->mInstance, instance->event_mouseclicked, NULL);
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "EnterWindow") == 0) {
if (instance->event_enterwindow != NULL) {
NPN_GetURL(instance->mInstance, instance->event_enterwindow, NULL);
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "LeaveWindow") == 0) {
if (instance->event_leavewindow != NULL) {
NPN_GetURL(instance->mInstance, instance->event_leavewindow, NULL);
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "MouseDown") == 0) {
if (instance->event_mousedown != NULL) {
tmp = g_strdup_printf("%s(%i);", instance->event_mousedown, i);
NPN_GetURL(instance->mInstance, tmp, NULL);
g_free(tmp);
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "MouseUp") == 0) {
if (instance->event_mouseup != NULL) {
tmp = g_strdup_printf("%s(%i);", instance->event_mouseup, i);
NPN_GetURL(instance->mInstance, tmp, NULL);
g_free(tmp);
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "TimeChanged") == 0) {
if (instance->post_dom_events && instance->id != NULL) {
postDOMEvent(instance->mInstance, instance->id, "qt_timechanged");
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "Ended") == 0) {
if (instance->post_dom_events && instance->id != NULL) {
postDOMEvent(instance->mInstance, instance->id, "qt_ended");
}
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "MediaStopped") == 0) {
if (instance->post_dom_events && instance->id != NULL) {
postDOMEvent(instance->mInstance, instance->id, "qt_ended");
}
postPlayStateChange(instance->mInstance, STATE_STOPPED);
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "MediaPlaying") == 0) {
if (instance->post_dom_events && instance->id != NULL) {
postDOMEvent(instance->mInstance, instance->id, "qt_play");
}
postPlayStateChange(instance->mInstance, STATE_PLAYING);
return DBUS_HANDLER_RESULT_HANDLED;
}
if (g_ascii_strcasecmp(s, "MediaPaused") == 0) {
if (instance->post_dom_events && instance->id != NULL) {
postDOMEvent(instance->mInstance, instance->id, "qt_pause");
}
postPlayStateChange(instance->mInstance, STATE_PAUSED);
return DBUS_HANDLER_RESULT_HANDLED;
}
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
}
} else {
// printf("path didn't match path = %s\n", path);
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
DBusConnection *dbus_hookup(CPlugin * instance)
{
DBusConnection *connection;
DBusError dberror;
DBusBusType type = DBUS_BUS_SESSION;
dbus_error_init(&dberror);
connection = dbus_bus_get_private(type, &dberror);
dbus_connection_setup_with_g_main(connection, NULL);
dbus_bus_add_match(connection, "type='signal',interface='com.gecko.mediaplayer'", NULL);
dbus_connection_add_filter(connection, filter_func, instance, NULL);
gm_log(instance->debug_level, G_LOG_LEVEL_INFO,
"DBUS connection created\nListening to path %s\n", instance->path);
return connection;
}
DBusConnection *dbus_unhook(DBusConnection * connection, CPlugin * instance)
{
dbus_connection_flush(connection);
dbus_connection_remove_filter(connection, filter_func, instance);
dbus_connection_close(connection);
dbus_connection_unref(connection);
return NULL;
}
void open_location(CPlugin * instance, ListItem * item, gboolean uselocal)
{
DBusMessage *message;
const char *file;
const char *id;
char *path;
GError *error = NULL;
gchar *argvn[255];
gint arg = 0;
gint ok;
gchar *app_name;
gchar *nullstr;
//list_dump(instance->playlist);
//printf("Opening %s to connection %p\n",file, instance->connection);
if (item == NULL || instance == NULL)
return;
postPlayStateChange(instance->mInstance, STATE_PLAYING);
if (!(instance->player_launched)) {
if (!item->opened) {
if (uselocal && strlen(item->local) > 0) {
file = g_strdup(item->local);
} else {
file = g_strdup(item->src);
}
gm_log(instance->debug_level, G_LOG_LEVEL_INFO,
"Opening %s with launch\nitem->hrefid = %i item->src = %s", file, item->hrefid,
item->src);
//printf("launching gnome-mplayer from Open with id = %i\n",instance->controlid);
app_name = NULL;
if (instance->player_backend != NULL) {
app_name = g_find_program_in_path(instance->player_backend);
}
if (app_name == NULL) {
app_name = g_find_program_in_path("gnome-mplayer");
if (app_name == NULL)
app_name = g_find_program_in_path("gnome-mplayer-minimal");
}
argvn[arg++] = g_strdup(app_name);
argvn[arg++] = g_strdup_printf("--window=-1");
argvn[arg++] = g_strdup_printf("--controlid=%i", instance->controlid);
argvn[arg++] = g_strdup_printf("--autostart=%i", instance->autostart);
if (instance->disable_context_menu == TRUE)
argvn[arg++] = g_strdup_printf("--disablecontextmenu");
if (instance->debug == TRUE)
argvn[arg++] = g_strdup_printf("--verbose");
argvn[arg++] = g_strdup_printf("%s", file);
argvn[arg] = NULL;
instance->playerready = FALSE;
ok = g_spawn_async(NULL, argvn, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error);
if (ok)
instance->player_launched = TRUE;
item->opened = TRUE;
instance->lastopened = item;
g_free(app_name);
}
return;
} else {
//printf("waiting for ready\n");
while (!(instance->playerready)) {
g_main_context_iteration(NULL, FALSE);
}
//printf("got player, waiting for controlid %i\n",item->controlid);
if (item->controlid != 0) {
while (!(item->playerready) && !item->cancelled) {
g_main_context_iteration(NULL, FALSE);
}
}
//printf("ready!\n");
}
// printf("item %s is opened == %i\n",item->src, item->opened);
if (!item->opened) {
if (uselocal && strlen(item->local) > 0) {
file = g_strdup(item->local);
} else {
file = g_strdup(item->src);
}
if (strlen(item->path) > 0) {
path = item->path;
} else {
path = instance->path;
}
gm_log(instance->debug_level, G_LOG_LEVEL_INFO,
"Sending Open %s to connection %p\nitem->hrefid = %i item->src = %s\n", file,
instance->connection, item->hrefid, item->src);
if (item->hrefid == 0) {
if (item->streaming) {
send_signal_with_double(instance, item, "SetCachePercent", 0);
nullstr = g_strdup("");
send_signal_with_string(instance, item, "SetProgressText", nullstr);
g_free(nullstr);
}
message = dbus_message_new_signal(path, "com.gnome.mplayer", "Open");
dbus_message_append_args(message, DBUS_TYPE_STRING, &file, DBUS_TYPE_INVALID);
dbus_connection_send(instance->connection, message, NULL);
dbus_message_unref(message);
if (item->retrieved == TRUE)
send_signal_with_double(instance, item, "SetCachePercent", 1.0);
} else {
// ok, not done here yet, may need a new window for Apple HD video
id = g_strdup_printf("%i", item->hrefid);
message = dbus_message_new_signal(path, "com.gnome.mplayer", "OpenButton");
dbus_message_append_args(message, DBUS_TYPE_STRING, &file,
DBUS_TYPE_STRING, &id, DBUS_TYPE_INVALID);
dbus_connection_send(instance->connection, message, NULL);
dbus_message_unref(message);
}
send_signal_with_string(instance, item, "SetURL", item->src);
item->opened = TRUE;
instance->lastopened = item;
} else {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Item '%s' already opened before",
item->src);
}
}
void resize_window(CPlugin * instance, ListItem * item, gint x, gint y)
{
DBusMessage *message;
gchar *path;
if (instance == NULL)
return;
if (x < 0 || y < 0)
return;
if (item != NULL && strlen(item->path) > 0) {
path = item->path;
} else {
path = instance->path;
}
if (instance->playerready) {
if (instance->connection != NULL && path != NULL) {
message = dbus_message_new_signal(path, "com.gnome.mplayer", "ResizeWindow");
dbus_message_append_args(message, DBUS_TYPE_INT32, &x,
DBUS_TYPE_INT32, &y, DBUS_TYPE_INVALID);
dbus_connection_send(instance->connection, message, NULL);
dbus_message_unref(message);
}
}
}
void send_signal(CPlugin * instance, ListItem * item, const gchar * signal)
{
DBusMessage *message;
const char *localsignal;
gchar *path;
// printf("Sending %s to connection %p\n", signal, instance->connection);
if (instance == NULL)
return;
if (instance->console != NULL) {
path = g_strdup_printf("/console/%s", instance->console);
} else {
if (item != NULL && strlen(item->path) > 0) {
path = g_strdup(item->path);
} else {
path = g_strdup(instance->path);
}
}
if (instance->playerready && instance->connection != NULL) {
localsignal = g_strdup(signal);
message = dbus_message_new_signal(path, "com.gnome.mplayer", localsignal);
dbus_connection_send(instance->connection, message, NULL);
dbus_message_unref(message);
}
g_free(path);
}
void send_signal_when_ready(CPlugin * instance, ListItem * item, const gchar * signal)
{
DBusMessage *message;
const char *localsignal;
gchar *path;
if (instance == NULL)
return;
if (item != NULL && strlen(item->path) > 0) {
path = item->path;
} else {
path = instance->path;
}
if (instance->player_launched) {
while (!(instance->playerready)) {
g_main_context_iteration(NULL, FALSE);
g_usleep(1000);
}
if (instance->playerready && (instance->connection != NULL)) {
//printf("Sending %s to connection %p\n", signal, instance->connection);
localsignal = g_strdup(signal);
message = dbus_message_new_signal(path, "com.gnome.mplayer", localsignal);
dbus_connection_send(instance->connection, message, NULL);
dbus_message_unref(message);
//printf("Sent %s to connection %p\n", signal, instance->connection);
}
}
}
void send_signal_with_string(CPlugin * instance, ListItem * item, const gchar * signal, gchar * str)
{
DBusMessage *message;
const char *localsignal;
const char *localstr;
gchar *path;
if (instance == NULL)
return;
// gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Sending %s to connection %p\n", signal,
// instance->connection);
if (instance->console != NULL) {
path = g_strdup_printf("/console/%s", instance->console);
} else {
if (item != NULL && strlen(item->path) > 0) {
path = g_strdup(item->path);
} else {
path = g_strdup(instance->path);
}
}
if (instance->playerready && instance->connection != NULL) {
localsignal = g_strdup(signal);
localstr = g_strdup(str);
message = dbus_message_new_signal(path, "com.gnome.mplayer", localsignal);
dbus_message_append_args(message, DBUS_TYPE_STRING, &localstr, DBUS_TYPE_INVALID);
dbus_connection_send(instance->connection, message, NULL);
dbus_message_unref(message);
}
g_free(path);
}
void send_signal_with_double(CPlugin * instance, ListItem * item, const gchar * signal, gdouble dbl)
{
DBusMessage *message;
const char *localsignal;
gchar *path;
if (instance == NULL)
return;
// gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Sending %s to connection %p\n", signal,
// instance->connection);
if (instance->console != NULL) {
path = g_strdup_printf("/console/%s", instance->console);
} else {
if (item != NULL && strlen(item->path) > 0) {
path = g_strdup(item->path);
} else {
path = g_strdup(instance->path);
}
}
if (instance->playerready && instance->connection != NULL) {
localsignal = g_strdup(signal);
message = dbus_message_new_signal(path, "com.gnome.mplayer", localsignal);
dbus_message_append_args(message, DBUS_TYPE_DOUBLE, &dbl, DBUS_TYPE_INVALID);
dbus_connection_send(instance->connection, message, NULL);
dbus_message_unref(message);
}
g_free(path);
}
void send_signal_with_boolean(CPlugin * instance, ListItem * item,
const gchar * signal, gboolean boolean)
{
DBusMessage *message;
const char *localsignal;
gchar *path;
//printf("Sending %s to connection %p\n", signal, instance->connection);
if (instance == NULL)
return;
if (instance->console != NULL) {
path = g_strdup_printf("/console/%s", instance->console);
} else {
if (item != NULL && strlen(item->path) > 0) {
path = g_strdup(item->path);
} else {
path = g_strdup(instance->path);
}
}
if (instance->playerready && instance->connection != NULL) {
localsignal = g_strdup(signal);
message = dbus_message_new_signal(path, "com.gnome.mplayer", localsignal);
dbus_message_append_args(message, DBUS_TYPE_BOOLEAN, &boolean, DBUS_TYPE_INVALID);
dbus_connection_send(instance->connection, message, NULL);
dbus_message_unref(message);
}
g_free(path);
}
void send_signal_with_integer(CPlugin * instance, ListItem * item, const gchar * signal, gint val)
{
DBusMessage *message;
const char *localsignal;
gchar *path;
//printf("Sending %s to connection %p\n", signal, instance->connection);
if (instance == NULL)
return;
if (instance->console != NULL) {
path = g_strdup_printf("/console/%s", instance->console);
} else {
if (item != NULL && strlen(item->path) > 0) {
path = g_strdup(item->path);
} else {
path = g_strdup(instance->path);
}
}
if (instance->playerready && instance->connection != NULL) {
localsignal = g_strdup(signal);
message = dbus_message_new_signal(path, "com.gnome.mplayer", localsignal);
dbus_message_append_args(message, DBUS_TYPE_INT32, &val, DBUS_TYPE_INVALID);
dbus_connection_send(instance->connection, message, NULL);
dbus_message_unref(message);
}
g_free(path);
}
gboolean request_boolean_value(CPlugin * instance, ListItem * item, const gchar * member)
{
DBusMessage *message;
DBusMessage *replymessage;
const gchar *localmember;
DBusError error;
gboolean result = FALSE;
gchar *path;
gchar *dest;
gint controlid;
//printf("Requesting %s to connection %p\n", member, instance->connection);
if (instance == NULL)
return result;
if (item != NULL && strlen(item->path) > 0) {
path = item->path;
controlid = item->controlid;
} else {
path = instance->path;
controlid = instance->controlid;
}
dest = g_strdup_printf("com.gnome.mplayer.cid%i", controlid);
if (instance->playerready && instance->connection != NULL) {
localmember = g_strdup(member);
message = dbus_message_new_method_call(dest, path, "com.gnome.mplayer", localmember);
dbus_error_init(&error);
replymessage =
dbus_connection_send_with_reply_and_block(instance->connection, message, -1, &error);
if (dbus_error_is_set(&error)) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Error message = %s\n", error.message);
}
dbus_message_get_args(replymessage, &error, DBUS_TYPE_BOOLEAN, &result, DBUS_TYPE_INVALID);
dbus_message_unref(message);
dbus_message_unref(replymessage);
}
g_free(dest);
return result;
}
gdouble request_double_value(CPlugin * instance, ListItem * item, const gchar * member)
{
DBusMessage *message;
DBusMessage *replymessage;
const gchar *localmember;
DBusError error;
gdouble result = 0.0;
gchar *path;
gchar *dest;
gint controlid;
//printf("Requesting %s to connection %p\n", member, instance->connection);
if (instance == NULL)
return result;
if (item != NULL && strlen(item->path) > 0) {
path = item->path;
controlid = item->controlid;
} else {
path = instance->path;
controlid = instance->controlid;
}
dest = g_strdup_printf("com.gnome.mplayer.cid%i", controlid);
if (instance->playerready && instance->connection != NULL) {
localmember = g_strdup(member);
message = dbus_message_new_method_call(dest, path, "com.gnome.mplayer", localmember);
dbus_error_init(&error);
replymessage =
dbus_connection_send_with_reply_and_block(instance->connection, message, -1, &error);
if (dbus_error_is_set(&error)) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Error message = %s\n", error.message);
}
dbus_message_get_args(replymessage, &error, DBUS_TYPE_DOUBLE, &result, DBUS_TYPE_INVALID);
dbus_message_unref(message);
dbus_message_unref(replymessage);
}
g_free(dest);
return result;
}
gint request_int_value(CPlugin * instance, ListItem * item, const gchar * member)
{
DBusMessage *message;
DBusMessage *replymessage;
const gchar *localmember;
DBusError error;
gint result = 0;
gchar *path;
gchar *dest;
gint controlid;
//printf("Requesting %s to connection %p\n", member, instance->connection);
if (instance == NULL)
return result;
if (item != NULL && strlen(item->path) > 0) {
path = item->path;
controlid = item->controlid;
} else {
path = instance->path;
controlid = instance->controlid;
}
dest = g_strdup_printf("com.gnome.mplayer.cid%i", controlid);
if (instance->playerready && instance->connection != NULL) {
localmember = g_strdup(member);
message = dbus_message_new_method_call(dest, path, "com.gnome.mplayer", localmember);
dbus_error_init(&error);
replymessage =
dbus_connection_send_with_reply_and_block(instance->connection, message, -1, &error);
if (dbus_error_is_set(&error)) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Error message = %s\n", error.message);
}
dbus_message_get_args(replymessage, &error, DBUS_TYPE_INT32, &result, DBUS_TYPE_INVALID);
dbus_message_unref(message);
dbus_message_unref(replymessage);
}
g_free(dest);
return result;
}
gchar *request_string_value(CPlugin * instance, ListItem * item, const gchar * member)
{
DBusMessage *message;
DBusMessage *replymessage;
const gchar *localmember;
DBusError error;
gchar *result = NULL;
gchar *path;
gchar *dest;
gint controlid;
//printf("Requesting %s to connection %p\n", member, instance->connection);
if (instance == NULL)
return result;
if (item != NULL && strlen(item->path) > 0) {
path = item->path;
controlid = item->controlid;
} else {
path = instance->path;
controlid = instance->controlid;
}
dest = g_strdup_printf("com.gnome.mplayer.cid%i", controlid);
if (instance->playerready && instance->connection != NULL) {
localmember = g_strdup(member);
message = dbus_message_new_method_call(dest, path, "com.gnome.mplayer", localmember);
dbus_error_init(&error);
replymessage =
dbus_connection_send_with_reply_and_block(instance->connection, message, -1, &error);
if (dbus_error_is_set(&error)) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Error message = %s\n", error.message);
}
dbus_message_get_args(replymessage, &error, DBUS_TYPE_STRING, &result, DBUS_TYPE_INVALID);
dbus_message_unref(message);
dbus_message_unref(replymessage);
}
g_free(dest);
return result;
}
gboolean is_valid_path(CPlugin * instance, const char *message)
{
gboolean result = FALSE;
ListItem *item;
GList *iter;
if (instance == NULL)
return result;
if (g_ascii_strcasecmp(message, instance->path) == 0) {
result = TRUE;
} else if (g_ascii_strcasecmp(message, "/DEBUG") == 0) {
result = TRUE;
} else {
if (instance->playlist != NULL) {
for (iter = instance->playlist; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (g_ascii_strcasecmp(message, item->path) == 0) {
result = TRUE;
}
}
}
}
}
return result;
}
gint request_bitrate(CPlugin * instance, ListItem * item, gchar * name)
{
DBusMessage *message;
DBusMessage *replymessage;
const gchar *localmember;
const gchar *localname;
DBusError error;
gint result = 0;
gchar *path;
gchar *dest;
gint controlid;
//printf("Requesting %s to connection %p\n", member, instance->connection);
if (instance == NULL)
return result;
if (item != NULL && strlen(item->path) > 0) {
path = item->path;
controlid = item->controlid;
} else {
path = instance->path;
controlid = instance->controlid;
}
dest = g_strdup_printf("com.gnome.mplayer.cid%i", controlid);
if (instance->playerready && instance->connection != NULL) {
localmember = g_strdup("GetBitrate");
localname = g_strdup(name);
message = dbus_message_new_method_call(dest, path, "com.gnome.mplayer", localmember);
dbus_message_append_args(message, DBUS_TYPE_STRING, &localname, DBUS_TYPE_INVALID);
dbus_error_init(&error);
replymessage =
dbus_connection_send_with_reply_and_block(instance->connection, message, -1, &error);
if (dbus_error_is_set(&error)) {
gm_log(instance->debug_level, G_LOG_LEVEL_INFO, "Error message = %s\n", error.message);
}
if (replymessage != NULL) {
dbus_message_get_args(replymessage, &error, DBUS_TYPE_INT32, &result,
DBUS_TYPE_INVALID);
dbus_message_unref(replymessage);
}
dbus_message_unref(message);
}
g_free(dest);
return result;
}
gecko-mediaplayer-1.0.8/src/plugin_types_qt.cpp 0000664 0001750 0001750 00000007560 12007254567 016566 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plugin_types.h"
gchar *GetMIMEDescription()
{
gchar MimeTypes[4000];
GmPrefStore *store;
gboolean qt_disabled = FALSE;
g_type_init();
store = gm_pref_store_new("gecko-mediaplayer");
if (store != NULL) {
qt_disabled = gm_pref_store_get_boolean(store, DISABLE_QT);
gm_pref_store_free(store);
}
if (qt_disabled) {
return NULL;
} else {
g_strlcpy(MimeTypes,
"video/quicktime:mov:Quicktime;"
"video/x-quicktime:mov:Quicktime;"
"image/x-quicktime:mov:Quicktime;"
"video/quicktime:mp4:Quicktime;"
"video/quicktime:sdp:Quicktime - Session Description Protocol;"
"application/x-quicktimeplayer:mov:Quicktime;", sizeof(MimeTypes));
return g_strdup(MimeTypes);
}
}
NPError PluginGetValue(NPPVariable variable, void *value)
{
NPError err = NPERR_NO_ERROR;
// some sites use this description to figure out what formats can be played. So we have to make sure the
// description matches the features
if (variable == NPPVpluginNameString) {
*((const char **) value) = "QuickTime Plug-in 7.6.9";
}
if (variable == NPPVpluginDescriptionString) {
*((const char **) value) =
"Gecko Media Player "
VERSION
"
Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer";
}
if (variable == NPPVpluginNeedsXEmbed) {
*((bool *) value) = TRUE;
}
if ((variable != NPPVpluginNameString)
&& (variable != NPPVpluginDescriptionString)
&& (variable != NPPVpluginNeedsXEmbed)) {
err = NPERR_INVALID_PARAM;
}
return err;
}
void pluginSpecific(CPlugin * instance)
{
//printf("calling pluginSpecific for qt plugin\n");
//setPreference(instance, "general.useragent.override", "QuickTime/7.6.9");
gm_log(TRUE, G_LOG_LEVEL_INFO, "Loading QuickTime compatibility\n");
instance->quicktime_emulation = TRUE;
}
gecko-mediaplayer-1.0.8/src/plugin.h 0000664 0001750 0001750 00000015365 12021477073 014300 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __PLUGIN_H__
#define __PLUGIN_H__
#include
#include
#include
#include
#include
#include
#ifdef HAVE_CONFIG_H
#include
#endif
#include
#include
#include
#include "plugin_list.h"
#ifdef ENABLE_NLS
#include
#endif
#ifdef HAVE_CURL
#include
#endif
#include
// JavaScript Playstates
#define STATE_UNDEFINED 0
#define STATE_STOPPED 1
#define STATE_PAUSED 2
#define STATE_PLAYING 3
#define STATE_SCANFORWARD 4
#define STATE_SCANREVERSE 5
#define STATE_BUFFERING 6
#define STATE_WAITING 7
#define STATE_MEDIAENDED 8
#define STATE_TRANSITIONING 9
#define STATE_READY 10
#define STATE_RECONNECTING 11
// config settings stored in gconf
#define DISABLE_QT "disable-qt"
#define DISABLE_REAL "disable-real"
#define DISABLE_WMP "disable-wmp"
#define DISABLE_DVX "disable-dvx"
#define DEBUG_LEVEL "debug-level"
#define DISABLE_MIDI "disable-midi"
#define PLAYER_BACKEND "player-backend"
typedef enum {
PLAYING,
PAUSED,
STOPPED,
QUIT
} PLAYSTATE;
void postDOMEvent(NPP mInstance, const gchar * id, const gchar * event);
void postPlayStateChange(NPP mInstance, const gint state);
const gchar *NPErrorToString(NPError error);
const gchar *NPReasonToString(NPReason reason);
class CPlugin {
private:
NPWindow * m_Window;
NPStream *m_pNPStream;
NPBool mInitialized;
NPObject *m_pScriptableObject;
NPObject *m_pScriptableObjectControls;
NPObject *m_pScriptableObjectSettings;
NPObject *m_pScriptableObjectMedia;
NPObject *m_pScriptableObjectError;
public:
CPlugin(NPP pNPInstance);
~CPlugin();
NPBool init(NPWindow * aWindow);
void shut();
NPBool isInitialized();
int16_t handleEvent(void *event);
NPObject *GetScriptableObject();
NPObject *GetScriptableObjectControls();
NPObject *GetScriptableObjectSettings();
NPObject *GetScriptableObjectMedia();
NPObject *GetScriptableObjectError();
NPError GetValue(NPPVariable variable, void *value);
NPError SetWindow(NPWindow * aWindow);
NPError NewStream(NPMIMEType type, NPStream * stream, NPBool seekable, uint16_t * stype);
NPError DestroyStream(NPStream * stream, NPError reason);
void URLNotify(const char *url, NPReason reason, void *notifyData);
int32_t WriteReady(NPStream * stream);
int32_t Write(NPStream * stream, int32_t offset, int32_t len, void *buffer);
NPError GetURLNotify(NPP instance, const char *url, const char *target, void *notifyData);
void Play();
void Pause();
void PlayPause();
void Stop();
void FastForward();
void FastReverse();
void Seek(double counter);
void SetShowControls(bool value);
void SetFullScreen(bool value);
void SetVolume(double value);
void GetVolume(double *_retval);
void GetFullScreen(bool * _retval);
void GetShowControls(bool * _retval);
void GetTime(double *_retval);
void GetDuration(double *_retval);
void GetPercent(double *_retval);
void GetBitrate(int *_retval);
void GetPlayState(int32_t * playstate);
void SetFilename(const char *filename);
void GetFilename(char **filename);
void GetMIMEType(char **_retval);
void GetLoop(bool * _retval);
void SetLoop(bool value);
void SetOnClick(const char *event);
void SetOnMediaComplete(const char *event);
void SetOnMouseUp(const char *event);
void SetOnMouseDown(const char *event);
void SetOnMouseOut(const char *event);
void SetOnMouseOver(const char *event);
void SetOnDestroy(const char *event);
private:
gint mX, mY;
gint mWidth, mHeight;
public:
Window mWindow;
NPP mInstance;
gchar *page_url;
gboolean windowless;
gint nextid;
uint16_t mode;
gchar *mimetype;
GList *playlist;
gboolean acceptdata;
gchar *path;
gboolean player_launched;
gboolean playerready;
DBusConnection *connection;
GThread *dbus_dispatch;
ListItem *lastopened;
gint cache_size;
gboolean hidden;
gint controlid;
gint state;
gint autostart;
time_t lastupdate;
gboolean disable_context_menu;
gboolean disable_fullscreen;
gboolean debug;
gint show_controls;
gchar *name;
gchar *id;
gchar *console;
gchar *controls;
gchar *user_agent;
gchar *player_backend;
gboolean quicktime_emulation;
// events
gboolean post_dom_events;
gchar *event_mediacomplete;
gchar *event_destroy;
gchar *event_mousedown;
gchar *event_mouseup;
gchar *event_mouseclicked;
gchar *event_enterwindow;
gchar *event_leavewindow;
// options
gint debug_level;
// tv options
gchar *tv_device;
gchar *tv_driver;
gchar *tv_input;
gint tv_width;
gint tv_height;
};
void pluginSpecific(CPlugin * instance);
void setPreference(CPlugin * instance, const gchar * name, const gchar * value);
#endif // __PLUGIN_H__
gecko-mediaplayer-1.0.8/src/plugin_list.cpp 0000664 0001750 0001750 00000076661 12021477073 015674 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plugin_list.h"
gint asx_loop;
gint entry_id = 0;
GList *parser_list;
ListItem *parser_item;
gboolean global_detect_only;
extern gint streaming(gchar * url);
ListItem *list_find(GList * list, gchar * url)
{
ListItem *item;
GList *iter;
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
// printf("list_find item = %s, url = %s\n",item->src,url);
if (item != NULL) {
if (g_ascii_strcasecmp(item->src, url) == 0 && item->play == TRUE) {
// printf("found %s at %p\n",url,item);
return item;
}
}
}
return NULL;
}
ListItem *list_find_by_id(GList * list, gint id)
{
ListItem *item;
GList *iter;
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (item->id == id) {
return item;
}
}
}
return NULL;
}
ListItem *list_find_by_controlid(GList * list, gint id)
{
ListItem *item;
GList *iter;
ListItem *ret = NULL;
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
if (iter != NULL) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (item->controlid == id) {
ret = item;
}
}
}
}
return ret;
}
void list_mark_controlid_ready(GList * list, gint id)
{
ListItem *item;
GList *iter;
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (item->controlid == id) {
item->playerready = TRUE;
}
}
}
return;
}
void list_mark_controlid_cancelled(GList * list, gint id, gboolean cancelled)
{
ListItem *item;
GList *iter;
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (item->controlid == id) {
item->cancelled = cancelled;
item->opened = FALSE;
item->playerready = FALSE;
item->requested = FALSE;
item->retrieved = FALSE;
item->played = FALSE;
}
}
}
return;
}
void list_mark_id_played(GList * list, gint id)
{
ListItem *item;
GList *iter;
if (id < 0)
return;
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (item->id == id) {
item->played = TRUE;
}
}
}
}
ListItem *list_find_next_playable(GList * list)
{
ListItem *item;
GList *iter;
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (item->played == FALSE && item->play == TRUE) {
// printf("next playable is %s\n",item->src);
return item;
}
}
}
return NULL;
}
ListItem *list_find_next_playable_after_listitem(GList * list, ListItem * find)
{
ListItem *item;
GList *iter;
ListItem *found = NULL;
if (list != NULL && find != NULL) {
for (iter = g_list_last(list); iter != NULL; iter = g_list_previous(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (g_ascii_strcasecmp(find->src, item->src) == 0) {
return found;
}
if (item->played == FALSE && item->play == TRUE) {
found = item;
}
}
}
}
return NULL;
}
ListItem *list_find_first_playable(GList * list)
{
ListItem *item;
GList *iter;
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (item->play == TRUE) {
return item;
}
}
}
return NULL;
}
gboolean list_item_opened(GList * list)
{
ListItem *item;
GList *iter;
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (item->opened == TRUE) {
return TRUE;
}
}
}
return FALSE;
}
void list_qualify_url(GList * list, gchar * page_url)
{
ListItem *item;
GList *iter;
gchar *tmp;
gchar url[4096];
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL && item->streaming) {
tmp = g_strrstr(item->src, "://");
if (!tmp && !g_file_test(item->src, G_FILE_TEST_EXISTS)) {
if (page_url != NULL) {
//printf("page_url = %s\n", instance->page_url);
g_strlcpy(url, item->src, 4096);
g_strlcpy(item->src, page_url, 1024);
tmp = g_strrstr(item->src, "/");
tmp[1] = '\0';
//printf("item->src = %s\n", item->src);
g_strlcat(item->src, url, 4096);
}
}
}
}
}
GList *list_clear(GList * list)
{
ListItem *item;
GList *iter;
// printf("clearing list\n");
if (list != NULL) {
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
if (item->localfp) {
fclose(item->localfp);
}
if (strlen(item->local) > 0) {
g_unlink(item->local);
}
}
}
g_list_free(list);
}
return NULL;
}
void list_dump(GList * list)
{
ListItem *item;
GList *iter;
gint count = 1;
if (list != NULL) {
for (iter = list; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
gm_log(TRUE, G_LOG_LEVEL_INFO, "----- Item %i -----", count++);
gm_log(TRUE, G_LOG_LEVEL_INFO, "src = %s", item->src);
gm_log(TRUE, G_LOG_LEVEL_INFO, "local = %s", item->local);
gm_log(TRUE, G_LOG_LEVEL_INFO, "id = %i", item->id);
gm_log(TRUE, G_LOG_LEVEL_INFO, "localsize = %i", item->localsize);
gm_log(TRUE, G_LOG_LEVEL_INFO, "lastsize = %i", item->lastsize);
gm_log(TRUE, G_LOG_LEVEL_INFO, "hrefid = %i", item->hrefid);
gm_log(TRUE, G_LOG_LEVEL_INFO, "requested = %i", item->requested);
gm_log(TRUE, G_LOG_LEVEL_INFO, "retrieved = %i", item->retrieved);
gm_log(TRUE, G_LOG_LEVEL_INFO, "cancelled = %i", item->cancelled);
gm_log(TRUE, G_LOG_LEVEL_INFO, "streaming = %i", item->streaming);
gm_log(TRUE, G_LOG_LEVEL_INFO, "opened = %i", item->opened);
gm_log(TRUE, G_LOG_LEVEL_INFO, "oktoplay = %i", item->oktoplay);
gm_log(TRUE, G_LOG_LEVEL_INFO, "queuedtoplay = %i", item->queuedtoplay);
gm_log(TRUE, G_LOG_LEVEL_INFO, "play = %i", item->play);
gm_log(TRUE, G_LOG_LEVEL_INFO, "played = %i", item->played);
gm_log(TRUE, G_LOG_LEVEL_INFO, "playlist = %i", item->playlist);
gm_log(TRUE, G_LOG_LEVEL_INFO, "path = %s", item->path);
gm_log(TRUE, G_LOG_LEVEL_INFO, "controlid = %i", item->controlid);
gm_log(TRUE, G_LOG_LEVEL_INFO, "playerready = %i", item->playerready);
gm_log(TRUE, G_LOG_LEVEL_INFO, "newwindow = %i", item->newwindow);
gm_log(TRUE, G_LOG_LEVEL_INFO, "loop = %i", item->loop);
gm_log(TRUE, G_LOG_LEVEL_INFO, "loopcount = %i", item->loopcount);
gm_log(TRUE, G_LOG_LEVEL_INFO, "plugin = %p", item->plugin);
}
}
}
}
GList *list_parse_qt(GList * list, ListItem * item, gboolean detect_only)
{
ListItem *newitem;
gchar *data;
gsize datalen;
gchar *p;
gchar *nextrmda = NULL;
gchar *rdrf; // this is the pointer to a URL that we are adding
gchar *rmdr; // this is data about the URL
gchar url[1024];
gchar *ptr;
unsigned int code = 0; // some value about the URL
gboolean added = FALSE;
// printf("Entering list_parse_qt localsize = %i\n", item->localsize);
if (item->localsize < (16 * 1024)) {
if (g_file_get_contents(item->local, &data, &datalen, NULL)) {
//printf("read %i bytes from %s\n",datalen, item->local);
p = (gchar *) memmem_compat(data, datalen, "rmda", 4);
if (p == NULL) {
gm_log(TRUE, G_LOG_LEVEL_DEBUG, "unable to find rmda in %s", item->local);
return list;
} else {
if (datalen > 4) {
p += 4; // skip the rmda tag we just found
// and find the next one
nextrmda = (gchar *) memmem_compat(p, datalen - (p - data), "rmda", 4);
if (nextrmda == NULL) {
nextrmda = data + datalen; // point the pointer at the end of the buffer
}
}
while (p != NULL && !added) {
rdrf =
(gchar *) memmem_compat(p, datalen - ((long) nextrmda - (long) p), "rdrf",
4);
rmdr =
(gchar *) memmem_compat(p, datalen - ((long) nextrmda - (long) p), "rmdr",
4);
if (rdrf != NULL) {
code = (unsigned int) (rdrf[15]);
rdrf = rdrf + 16;
//printf("URL: %s\n", rdrf);
//printf("CODE: %d\n", code);
}
g_strlcpy(url, item->src, 1024);
ptr = g_strrstr(url, "/");
if (ptr != NULL && g_strrstr(rdrf, "://") == NULL) {
ptr++;
ptr[0] = (char) NULL;
g_strlcat(url, rdrf, 1024);
} else {
g_strlcpy(url, rdrf, 1024);
}
if (rdrf != NULL) {
if (code == 163 || code == 165 || code == 167
|| code == (unsigned int) -93
|| code == (unsigned int) -91 || code == (unsigned int) -89) {
gm_log(TRUE, G_LOG_LEVEL_INFO, "Skipped URL: %s\n", rdrf);
} else {
if (list_find(list, url) == NULL && strlen(rdrf) > 0) {
if (!detect_only) {
item->play = FALSE;
newitem = g_new0(ListItem, 1);
g_strlcpy(newitem->src, url, 1024);
// newitem->streaming = streaming(newitem->src);
newitem->play = TRUE;
newitem->id = item->id;
newitem->controlid = item->controlid;
g_strlcpy(newitem->path, item->path, 1024);
item->id = -1;
list = g_list_append(list, newitem);
}
added = TRUE;
}
}
}
p = nextrmda + 4;
if (p > (data + datalen)) {
p = NULL;
} else {
nextrmda = (gchar *) memmem_compat(p, datalen - (p - data), "rmda", 4);
if (nextrmda == NULL) {
nextrmda = data + datalen; // point the pointer at the end of the buffer
}
}
}
}
} else {
// printf("Unable to open %s \n",item->local);
}
// list_dump(list);
} else {
// if file is over 16K it is probably not a playlist
// so skip parsing it.
//printf("file not parsed > 16K actual size is %i\n",item->localsize);
}
// printf("Exiting list_parse_qt\n");
if (added) {
item->playlist = TRUE;
}
return list;
}
GList *list_parse_qt2(GList * list, ListItem * item, gboolean detect_only)
{
ListItem *newitem;
gchar *data;
gsize datalen;
gchar *p;
gchar url[1024];
gchar *ptr;
gchar *urlptr;
gboolean added = FALSE;
// printf("Entering list_parse_qt2 localsize = %i\n", item->localsize);
if (item->localsize < (256 * 1024)) {
if (g_file_get_contents(item->local, &data, &datalen, NULL)) {
//printf("read %i bytes from %s\n",datalen, item->local);
p = (gchar *) memmem_compat(data, datalen, "mmdr", 4);
if (p == NULL) {
gm_log(TRUE, G_LOG_LEVEL_DEBUG, "unable to find mmdr in %s", item->local);
return list;
} else {
while (p != NULL && !added) {
urlptr = (gchar *) memmem_compat(p, datalen - (p - data), "url ", 4);
if (urlptr == NULL) {
p = NULL;
} else {
urlptr += strlen("url ");
g_strlcpy(url, item->src, 1024);
ptr = g_strrstr(url, "/");
if (ptr != NULL && g_strrstr(urlptr, "://") == NULL) {
ptr++;
ptr[0] = (char) NULL;
g_strlcat(url, urlptr, 1024);
} else {
g_strlcpy(url, urlptr, 1024);
}
if (list_find(list, url) == NULL) {
if (!detect_only) {
item->play = FALSE;
newitem = g_new0(ListItem, 1);
g_strlcpy(newitem->src, url, 1024);
// newitem->streaming = streaming(newitem->src);
newitem->play = TRUE;
newitem->id = item->id;
newitem->controlid = item->controlid;
g_strlcpy(newitem->path, item->path, 1024);
item->id = -1;
list = g_list_append(list, newitem);
}
added = TRUE;
}
p = (gchar *) memmem_compat(urlptr, datalen - (urlptr - data), "mmdr", 4);
}
}
}
} else {
// printf("Unable to open %s \n",item->local);
}
// list_dump(list);
} else {
// if file is over 256K it is probably not a playlist
// so skip parsing it.
//printf("file not parsed > 256K actual size is %i\n",item->localsize);
}
// printf("Exiting list_parse_qt2\n");
if (added) {
item->playlist = TRUE;
}
return list;
}
void strip_unicode(gchar * data, gsize len)
{
gsize i = 0;
for (i = 0; i < len; i++) {
if (!g_unichar_validate(data[i])) {
data[i] = ' ';
}
}
}
gboolean entities_present(gchar * data, gsize len)
{
if (g_strstr_len(data, len, "&") != NULL)
return TRUE;
if (g_strstr_len(data, len, "<") != NULL)
return TRUE;
if (g_strstr_len(data, len, ">") != NULL)
return TRUE;
if (g_strstr_len(data, len, """) != NULL)
return TRUE;
if (g_strstr_len(data, len, "'") != NULL)
return TRUE;
return FALSE;
}
void replace_amp(gchar * data)
{
gchar *pos;
pos = g_strrstr(data, "&");
while (pos) {
pos[0] = '\x01';
pos = g_strrstr(data, "&");
}
}
void unreplace_amp(gchar * data)
{
gchar *pos;
pos = g_strrstr(data, "\x01");
while (pos) {
pos[0] = '&';
pos = g_strrstr(data, "\x01");
}
}
GList *list_parse_asx(GList * list, ListItem * item, gboolean detect_only)
{
GMarkupParseContext *context;
gchar *data;
gsize datalen;
// printf("Entering list_parse_asx localsize = %i\n", item->localsize);
if (item->localsize < (16 * 1024)) {
if (g_file_get_contents(item->local, &data, &datalen, NULL)) {
parser_list = list;
parser_item = item;
global_detect_only = detect_only;
asx_loop = 0;
strip_unicode(data, datalen);
replace_amp(data);
context = g_markup_parse_context_new(&asx_parser, (GMarkupParseFlags) 0, data, NULL);
g_markup_parse_context_parse(context, data, datalen, NULL);
g_markup_parse_context_free(context);
global_detect_only = FALSE;
parser_item = NULL;
parser_list = NULL;
}
// list_dump(list);
}
// printf("Exiting list_parse_asx\n");
return list;
}
void
asx_start_element(GMarkupParseContext * context,
const gchar * element_name,
const gchar ** attribute_names,
const gchar ** attribute_values, gpointer user_data, GError ** error)
{
ListItem *newitem;
gchar *value;
gint i = 0;
gchar *ptr;
gchar url[1024];
if (g_ascii_strcasecmp(element_name, "REF") == 0) {
while (attribute_names[i] != NULL) {
if (g_ascii_strcasecmp(attribute_names[i], "HREF") == 0) {
if (list_find(parser_list, (gchar *) attribute_values[i])
== NULL) {
parser_item->play = FALSE;
parser_item->playlist = TRUE;
if (!global_detect_only) {
newitem = g_new0(ListItem, 1);
value = g_strdup(attribute_values[i]);
unreplace_amp(value);
ptr = g_strrstr(value, "/");
if (ptr == NULL) {
g_strlcpy(url, parser_item->src, 1024);
ptr = g_strrstr(url, "/");
if (ptr != NULL) {
ptr[1] = (char) NULL;
g_strlcpy(newitem->src, url, 1024);
g_strlcat(newitem->src, value, 1024);
}
} else {
g_strlcpy(newitem->src, value, 1024);
}
g_free(value);
newitem->streaming = streaming(newitem->src);
// crappy hack, mplayer needs the protocol in lower case, some sites don't
if (newitem->streaming) {
newitem->src[0] = g_ascii_tolower(newitem->src[0]);
newitem->src[1] = g_ascii_tolower(newitem->src[1]);
newitem->src[2] = g_ascii_tolower(newitem->src[2]);
newitem->src[3] = g_ascii_tolower(newitem->src[3]);
}
newitem->play = TRUE;
if (entry_id != 0) {
newitem->id = entry_id;
} else {
newitem->id = parser_item->id;
parser_item->id = -1;
}
newitem->controlid = parser_item->controlid;
if (asx_loop != 0) {
newitem->loop = TRUE;
newitem->loopcount = asx_loop;
}
g_strlcpy(newitem->path, parser_item->path, 1024);
parser_list = g_list_append(parser_list, newitem);
}
}
}
i++;
}
}
if (g_ascii_strcasecmp(element_name, "REPEAT") == 0)
asx_loop--;
if (g_ascii_strcasecmp(element_name, "ENTRYREF") == 0) {
entry_id = entry_id + 100;
while (attribute_names[i] != NULL) {
if (g_ascii_strcasecmp(attribute_names[i], "HREF") == 0) {
if (list_find(parser_list, (gchar *) attribute_values[i])
== NULL) {
parser_item->play = FALSE;
parser_item->playlist = TRUE;
newitem = g_new0(ListItem, 1);
value = g_strdup(attribute_values[i]);
unreplace_amp(value);
ptr = g_strrstr(value, "/");
if (ptr == NULL) {
g_strlcpy(url, parser_item->src, 1024);
ptr = g_strrstr(url, "/");
if (ptr != NULL) {
ptr[1] = (char) NULL;
g_strlcpy(newitem->src, url, 1024);
g_strlcat(newitem->src, value, 1024);
}
} else {
g_strlcpy(newitem->src, value, 1024);
}
g_free(value);
newitem->streaming = streaming(newitem->src);
// crappy hack, mplayer needs the protocol in lower case, some sites don't
if (newitem->streaming) {
newitem->src[0] = g_ascii_tolower(newitem->src[0]);
newitem->src[1] = g_ascii_tolower(newitem->src[1]);
newitem->src[2] = g_ascii_tolower(newitem->src[2]);
newitem->src[3] = g_ascii_tolower(newitem->src[3]);
}
newitem->play = TRUE;
newitem->id = entry_id;
newitem->controlid = parser_item->controlid;
if (asx_loop != 0) {
newitem->loop = TRUE;
newitem->loopcount = asx_loop;
}
g_strlcpy(newitem->path, parser_item->path, 1024);
parser_list = g_list_append(parser_list, newitem);
}
}
i++;
}
}
if (g_ascii_strcasecmp(element_name, "ENTRY") == 0) {
parser_item->play = 0;
entry_id = entry_id + 100;
}
}
void
asx_end_element(GMarkupParseContext * context,
const gchar * element_name, gpointer user_data, GError ** error)
{
if (g_ascii_strcasecmp(element_name, "REPEAT") == 0)
asx_loop++;
}
GList *list_parse_qml(GList * list, ListItem * item, gboolean detect_only)
{
GMarkupParseContext *context;
gchar *data;
gsize datalen;
// printf("Entering list_parse_qml localsize = %i\n", item->localsize);
if (item->localsize < (16 * 1024)) {
if (g_file_get_contents(item->local, &data, &datalen, NULL)) {
parser_list = list;
parser_item = item;
global_detect_only = detect_only;
asx_loop = 0;
strip_unicode(data, datalen);
replace_amp(data);
context = g_markup_parse_context_new(&qml_parser, (GMarkupParseFlags) 0, data, NULL);
g_markup_parse_context_parse(context, data, datalen, NULL);
g_markup_parse_context_free(context);
parser_item = NULL;
parser_list = NULL;
global_detect_only = FALSE;
}
// list_dump(list);
}
// printf("Exiting list_parse_qml\n");
return list;
}
void
qml_start_element(GMarkupParseContext * context,
const gchar * element_name,
const gchar ** attribute_names,
const gchar ** attribute_values, gpointer user_data, GError ** error)
{
ListItem *newitem;
gchar *value;
gint i = 0;
if (g_ascii_strcasecmp(element_name, "EMBED") == 0) {
while (attribute_names[i] != NULL) {
if (g_ascii_strcasecmp(attribute_names[i], "SRC") == 0) {
if (list_find(parser_list, (gchar *) attribute_values[i])
== NULL) {
if (parser_item->play) {
parser_item->play = FALSE;
parser_item->playlist = TRUE;
if (!global_detect_only) {
newitem = g_new0(ListItem, 1);
value = g_strdup(attribute_values[i]);
unreplace_amp(value);
g_strlcpy(newitem->src, value, 1024);
g_free(value);
newitem->streaming = streaming(newitem->src);
// crappy hack, mplayer needs the protocol in lower case, some sites don't
if (newitem->streaming) {
newitem->src[0] = g_ascii_tolower(newitem->src[0]);
newitem->src[1] = g_ascii_tolower(newitem->src[1]);
newitem->src[2] = g_ascii_tolower(newitem->src[2]);
newitem->src[3] = g_ascii_tolower(newitem->src[3]);
}
newitem->play = TRUE;
if (entry_id != 0) {
newitem->id = entry_id;
} else {
newitem->id = parser_item->id;
parser_item->id = -1;
}
newitem->controlid = parser_item->controlid;
if (asx_loop != 0) {
newitem->loop = TRUE;
newitem->loopcount = asx_loop;
}
g_strlcpy(newitem->path, parser_item->path, 1024);
parser_list = g_list_append(parser_list, newitem);
}
}
}
}
i++;
}
}
}
GList *list_parse_ram(GList * list, ListItem * item, gboolean detect_only)
{
gchar *data;
gsize datalen;
gchar **output;
gint i;
gboolean addline;
ListItem *newitem;
gchar *value;
gchar *ptr;
gchar url[1024];
// printf("Entering list_parse_ram localsize = %i\n", item->localsize);
if (item->localsize < (16 * 1024)) {
if (g_file_get_contents(item->local, &data, &datalen, NULL)) {
if (data != NULL) {
output = g_strsplit_set(data, "\n\r", 0);
parser_list = list;
parser_item = item;
i = 0;
while (output != NULL && output[i] != NULL) {
// printf("%s\n", output[i]);
addline = FALSE;
if (g_ascii_strncasecmp(output[i], "rtsp://", strlen("rtsp://")) == 0) {
addline = TRUE;
}
if (g_ascii_strncasecmp(output[i], "http://", strlen("http://")) == 0) {
addline = TRUE;
}
if (addline) {
if (list_find(parser_list, (gchar *) output[i])
== NULL) {
parser_item->play = FALSE;
parser_item->playlist = TRUE;
if (!detect_only) {
newitem = g_new0(ListItem, 1);
value = g_strdup(output[i]);
unreplace_amp(value);
ptr = g_strrstr(value, "/");
if (ptr == NULL) {
g_strlcpy(url, parser_item->src, 1024);
ptr = g_strrstr(url, "/");
if (ptr != NULL) {
ptr[1] = (char) NULL;
g_strlcpy(newitem->src, url, 1024);
g_strlcat(newitem->src, value, 1024);
}
} else {
g_strlcpy(newitem->src, value, 1024);
}
g_free(value);
newitem->streaming = streaming(newitem->src);
// crappy hack, mplayer needs the protocol in lower case, some sites don't
if (newitem->streaming) {
newitem->src[0] = g_ascii_tolower(newitem->src[0]);
newitem->src[1] = g_ascii_tolower(newitem->src[1]);
newitem->src[2] = g_ascii_tolower(newitem->src[2]);
newitem->src[3] = g_ascii_tolower(newitem->src[3]);
}
newitem->play = TRUE;
newitem->id = ++entry_id;
newitem->controlid = parser_item->controlid;
g_strlcpy(newitem->path, parser_item->path, 1024);
parser_list = g_list_append(parser_list, newitem);
}
}
}
i++;
}
g_strfreev(output);
parser_list = NULL;
parser_item = NULL;
}
}
// list_dump(list);
}
// printf("Exiting list_parse_ram\n");
return list;
}
gecko-mediaplayer-1.0.8/src/plugin.cpp 0000664 0001750 0001750 00000256631 12075005625 014635 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plugin.h"
//#include "npupp.h"
#include "plugin_list.h"
#include "plugin_setup.h"
#include "plugin_types.h"
#include "plugin_dbus.h"
#ifdef HAVE_NSPR
#include
#else
#include
#include
#include
#include
#endif
#include
static NPObject *sWindowObj;
//#include "nsIServiceManager.h"
//#include "nsISupportsUtils.h" // some usefule macros are defined here
#define MIME_TYPES_HANDLED "application/scriptable-plugin"
#define PLUGIN_NAME "Scriptable Example Plugin for Mozilla"
#define MIME_TYPES_DESCRIPTION MIME_TYPES_HANDLED":scr:"PLUGIN_NAME
#define PLUGIN_DESCRIPTION PLUGIN_NAME " (Plug-ins SDK sample)"
int32 STREAMBUFSIZE = 0X0FFFFFFF;
// methods
static NPIdentifier Play_id;
static NPIdentifier PlayAt_id;
static NPIdentifier Pause_id;
static NPIdentifier PlayPause_id;
static NPIdentifier Stop_id;
static NPIdentifier quit_id;
static NPIdentifier DoPlay_id;
static NPIdentifier DoPause_id;
static NPIdentifier FastForward_id;
static NPIdentifier FastReverse_id;
static NPIdentifier ff_id;
static NPIdentifier rew_id;
static NPIdentifier rewind_id;
static NPIdentifier Seek_id;
static NPIdentifier Open_id;
static NPIdentifier SetVolume_id;
static NPIdentifier GetVolume_id;
static NPIdentifier SetFileName_id;
static NPIdentifier GetFileName_id;
static NPIdentifier SetIsLooping_id;
static NPIdentifier GetIsLooping_id;
static NPIdentifier SetAutoPlay_id;
static NPIdentifier GetAutoPlay_id;
static NPIdentifier SetHREF_id;
static NPIdentifier GetHREF_id;
static NPIdentifier SetURL_id;
static NPIdentifier GetURL_id;
static NPIdentifier GetMIMEType_id;
static NPIdentifier getTime_id;
static NPIdentifier getDuration_id;
static NPIdentifier getPercent_id;
static NPIdentifier getBitrate_id;
static NPIdentifier isplaying_id;
static NPIdentifier playlistAppend_id;
static NPIdentifier playlistClear_id;
static NPIdentifier onClick_id;
static NPIdentifier onMediaComplete_id;
static NPIdentifier onMouseUp_id;
static NPIdentifier onMouseDown_id;
static NPIdentifier onMouseOut_id;
static NPIdentifier onMouseOver_id;
static NPIdentifier onDestroy_id;
static NPIdentifier controls_play_id;
static NPIdentifier controls_pause_id;
static NPIdentifier controls_stop_id;
static NPIdentifier controls_fastForward_id;
static NPIdentifier controls_fastReverse_id;
static NPIdentifier controls_step_id;
static NPIdentifier media_getItemInfo_id;
// properties
static NPIdentifier filename_id;
static NPIdentifier src_id;
static NPIdentifier ShowControls_id;
static NPIdentifier fullscreen_id;
static NPIdentifier showlogo_id;
static NPIdentifier playState_id;
static NPIdentifier controls_id;
static NPIdentifier media_id;
static NPIdentifier settings_id;
static NPIdentifier error_id;
static NPIdentifier status_id;
static NPIdentifier URL_id;
static NPIdentifier versionInfo_id;
static NPIdentifier enabled_id;
static NPIdentifier enableContextMenu_id;
static NPIdentifier controls_currentPosition_id;
static NPIdentifier controls_currentItem_id;
static NPIdentifier media_duration_id;
static NPIdentifier settings_volume_id;
static NPIdentifier error_errorCount_id;
//////////////////////////////////////
//
// general initialization and shutdown
//
NPError NS_PluginInitialize()
{
return NPERR_NO_ERROR;
}
void NS_PluginShutdown()
{
}
// get values per plugin
NPError NS_PluginGetValue(NPPVariable aVariable, void *aValue)
{
return PluginGetValue(aVariable, aValue);
}
void postDOMEvent(NPP mInstance, const gchar * id, const gchar * event)
{
gchar *jscript;
jscript = g_strdup_printf("javascript:obj_gmp=document.getElementById('%s');"
"e_gmp=document.createEvent('Events');"
"e_gmp.initEvent('%s',true,true);" "obj_gmp.dispatchEvent(e_gmp);",
id, event);
NPN_GetURL(mInstance, jscript, NULL);
g_free(jscript);
}
// disabled for now due to problems with certain sites
void postPlayStateChange(NPP mInstance, const gint state)
{
gchar *jscript;
jscript = g_strdup_printf("javascript:if (typeof OnDSPlayStateChangeEvt == 'function') {"
"OnDSPlayStateChangeEvt(%i);}", state);
//NPN_GetURL(mInstance, jscript, NULL);
g_free(jscript);
}
const gchar *NPReasonToString(NPReason reason)
{
switch (reason) {
case NPRES_DONE:
return "Done";
break;
case NPRES_NETWORK_ERR:
return "Network Error";
break;
case NPRES_USER_BREAK:
return "User Break";
break;
default:
return "Unknown Reason";
}
}
const gchar *NPErrorToString(NPError error)
{
switch (error) {
case NPERR_NO_ERROR:
return "No Error";
break;
case NPERR_GENERIC_ERROR:
return "Generic Error";
break;
case NPERR_INVALID_INSTANCE_ERROR:
return "Invalid Instance Error";
break;
case NPERR_INVALID_FUNCTABLE_ERROR:
return "Invalid Functable Error";
break;
case NPERR_MODULE_LOAD_FAILED_ERROR:
return "Module Load Failed Error";
break;
case NPERR_OUT_OF_MEMORY_ERROR:
return "Out Of Memory Error";
break;
case NPERR_INVALID_PLUGIN_ERROR:
return "Invalid Plugin Error";
break;
case NPERR_INVALID_PLUGIN_DIR_ERROR:
return "Invalid Plugin Dir Error";
break;
case NPERR_INCOMPATIBLE_VERSION_ERROR:
return "Incompatible Version Error";
break;
case NPERR_INVALID_PARAM:
return "Invalid Param";
break;
case NPERR_INVALID_URL:
return "Invalid URL";
break;
case NPERR_FILE_NOT_FOUND:
return "File Not Found";
break;
case NPERR_NO_DATA:
return "No Data";
break;
case NPERR_STREAM_NOT_SEEKABLE:
return "Stream Not Seekable";
break;
#ifdef NPERR_TIME_RANGE_NOT_SUPPORTED
case NPERR_TIME_RANGE_NOT_SUPPORTED:
return "Time Range Not Supported";
break;
#endif
#ifdef NPERR_MALFORMED_SITE
case NPERR_MALFORMED_SITE:
return "Malformed Site";
break;
#endif
default:
return "Unknown NPError Code";
break;
}
}
////////////////////////////////////////
//
// CPlugin class implementation
//
CPlugin::CPlugin(NPP pNPInstance):
mInstance(pNPInstance),
m_pNPStream(NULL),
mInitialized(FALSE),
m_pScriptableObject(NULL),
m_pScriptableObjectControls(NULL),
m_pScriptableObjectMedia(NULL),
m_pScriptableObjectSettings(NULL),
m_pScriptableObjectError(NULL),
mWindow(0),
windowless(FALSE),
playlist(NULL),
player_launched(FALSE),
connection(NULL),
dbus_dispatch(NULL),
path(NULL),
acceptdata(TRUE),
playerready(FALSE),
nextid(1),
lastopened(NULL),
cache_size(2048),
hidden(FALSE),
autostart(1),
lastupdate(0),
show_controls(1),
name(NULL),
id(NULL),
console(NULL),
controls(NULL),
user_agent(NULL),
page_url(NULL),
player_backend(NULL),
quicktime_emulation(FALSE),
disable_context_menu(FALSE),
disable_fullscreen(FALSE),
post_dom_events(FALSE),
event_mediacomplete(NULL),
event_destroy(NULL),
event_mousedown(NULL),
event_mouseup(NULL),
event_mouseclicked(NULL), event_enterwindow(NULL), event_leavewindow(NULL), debug(FALSE),
tv_driver(NULL), tv_device(NULL), tv_input(NULL), tv_width(0), tv_height(0)
{
GRand *rand;
GmPrefStore *store;
gboolean b;
NPN_GetValue(mInstance, NPNVWindowNPObject, &sWindowObj);
// get the page plugin was called from
// found at https://developer.mozilla.org/en/Getting_the_page_URL_in_NPAPI_plugin
NPIdentifier identifier = NPN_GetStringIdentifier("location");
// Declare a local variant value.
NPVariant variantValue;
// Get the location property from the window object (which is another object).
b = NPN_GetProperty(mInstance, sWindowObj, identifier, &variantValue);
// Get a pointer to the "location" object.
NPObject *locationObj = variantValue.value.objectValue;
// Create a "href" identifier.
identifier = NPN_GetStringIdentifier("href");
// Get the location property from the location object.
b = NPN_GetProperty(mInstance, locationObj, identifier, &variantValue);
#ifdef NPAPI_USE_UPPERCASE_UTF8
page_url = g_strdup_printf("%s", NPVARIANT_TO_STRING(variantValue).UTF8Characters);
#else
page_url = g_strdup_printf("%s", NPVARIANT_TO_STRING(variantValue).utf8characters);
#endif
// register methods
Play_id = NPN_GetStringIdentifier("Play");
PlayAt_id = NPN_GetStringIdentifier("PlayAt");
Pause_id = NPN_GetStringIdentifier("Pause");
PlayPause_id = NPN_GetStringIdentifier("PlayPause");
Stop_id = NPN_GetStringIdentifier("Stop");
quit_id = NPN_GetStringIdentifier("quit");
DoPlay_id = NPN_GetStringIdentifier("DoPlay");
DoPause_id = NPN_GetStringIdentifier("DoPause");
FastForward_id = NPN_GetStringIdentifier("FastForward");
FastReverse_id = NPN_GetStringIdentifier("FastReverse");
ff_id = NPN_GetStringIdentifier("ff");
rew_id = NPN_GetStringIdentifier("rew");
rewind_id = NPN_GetStringIdentifier("rewind");
Seek_id = NPN_GetStringIdentifier("Seek");
Open_id = NPN_GetStringIdentifier("Open");
SetVolume_id = NPN_GetStringIdentifier("SetVolume");
GetVolume_id = NPN_GetStringIdentifier("GetVolume");
SetFileName_id = NPN_GetStringIdentifier("SetFileName");
GetFileName_id = NPN_GetStringIdentifier("GetFileName");
SetIsLooping_id = NPN_GetStringIdentifier("SetIsLooping");
GetIsLooping_id = NPN_GetStringIdentifier("GetIsLooping");
SetAutoPlay_id = NPN_GetStringIdentifier("SetAutoPlay");
GetAutoPlay_id = NPN_GetStringIdentifier("GetAutoPlay");
SetHREF_id = NPN_GetStringIdentifier("SetHREF");
GetHREF_id = NPN_GetStringIdentifier("GetHREF");
SetURL_id = NPN_GetStringIdentifier("SetURL");
GetURL_id = NPN_GetStringIdentifier("GetURL");
GetMIMEType_id = NPN_GetStringIdentifier("GetMIMEType");
getTime_id = NPN_GetStringIdentifier("getTime");
getDuration_id = NPN_GetStringIdentifier("getDuration");
getPercent_id = NPN_GetStringIdentifier("getPercent");
getBitrate_id = NPN_GetStringIdentifier("getBitrate");
isplaying_id = NPN_GetStringIdentifier("isplaying");
playlistAppend_id = NPN_GetStringIdentifier("playlistAppend");
playlistClear_id = NPN_GetStringIdentifier("playlistClear");
onClick_id = NPN_GetStringIdentifier("onClick");
onMediaComplete_id = NPN_GetStringIdentifier("onMediaComplete");
onMouseUp_id = NPN_GetStringIdentifier("onMouseUp");
onMouseDown_id = NPN_GetStringIdentifier("onMouseDown");
onMouseOut_id = NPN_GetStringIdentifier("onMouseOut");
onMouseOver_id = NPN_GetStringIdentifier("onMouseOver");
onDestroy_id = NPN_GetStringIdentifier("onDestroy");
controls_play_id = NPN_GetStringIdentifier("play");
controls_pause_id = NPN_GetStringIdentifier("pause");
controls_stop_id = NPN_GetStringIdentifier("stop");
controls_fastForward_id = NPN_GetStringIdentifier("fastForward");
controls_fastReverse_id = NPN_GetStringIdentifier("fastReverse");
controls_step_id = NPN_GetStringIdentifier("step");
media_getItemInfo_id = NPN_GetStringIdentifier("getItemInfo");
// register properties
filename_id = NPN_GetStringIdentifier("filename");
src_id = NPN_GetStringIdentifier("src");
ShowControls_id = NPN_GetStringIdentifier("ShowControls");
fullscreen_id = NPN_GetStringIdentifier("fullscreen");
showlogo_id = NPN_GetStringIdentifier("showlogo");
playState_id = NPN_GetStringIdentifier("playState");
controls_id = NPN_GetStringIdentifier("controls");
controls_currentItem_id = NPN_GetStringIdentifier("currentItem");
media_id = NPN_GetStringIdentifier("media");
settings_id = NPN_GetStringIdentifier("settings");
error_id = NPN_GetStringIdentifier("error");
status_id = NPN_GetStringIdentifier("status");
URL_id = NPN_GetStringIdentifier("URL");
versionInfo_id = NPN_GetStringIdentifier("versionInfo");
enabled_id = NPN_GetStringIdentifier("enabled");
enableContextMenu_id = NPN_GetStringIdentifier("enableContextMenu");
controls_currentPosition_id = NPN_GetStringIdentifier("currentPosition");
media_duration_id = NPN_GetStringIdentifier("duration");
settings_volume_id = NPN_GetStringIdentifier("volume");
error_errorCount_id = NPN_GetStringIdentifier("errorCount");
// generate a random controlid
rand = g_rand_new();
controlid = g_rand_int_range(rand, 0, 65535);
g_rand_free(rand);
if (path == NULL) {
path = g_strdup_printf("/control/%i", controlid);
// printf("using path %s\n",path);
}
#ifdef ENABLE_NLS
bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
#endif
printf(_("gecko mediaplayer v%s\n"), VERSION);
g_type_init();
store = gm_pref_store_new("gecko-mediaplayer");
if (store != NULL) {
debug_level = gm_pref_store_get_int(store, DEBUG_LEVEL);
gm_log(debug_level, G_LOG_LEVEL_INFO, "debug_level = %i", debug_level);
player_backend = gm_pref_store_get_string(store, PLAYER_BACKEND);
gm_log(debug_level, G_LOG_LEVEL_INFO, "Using player backend of '%s'\n",
(player_backend == NULL || strlen(player_backend) == 0 ) ? "gnome-mplayer" : player_backend);
gm_pref_store_free(store);
} else {
gm_log(TRUE, G_LOG_LEVEL_INFO, "Unable to find preference store, setting debug_level to 1");
debug_level = 1;
}
if (connection == NULL) {
connection = dbus_hookup(this);
}
pluginSpecific(this);
mInitialized = TRUE;
}
CPlugin::~CPlugin()
{
// mScriptablePeer may be also held by the browser
// so releasing it here does not guarantee that it is over
// we should take precaution in case it will be called later
// and zero its mPlugin member
// mScriptablePeer->SetInstance(NULL);
// NS_IF_RELEASE(mScriptablePeer);
if (mInitialized)
shut();
if (sWindowObj)
NPN_ReleaseObject(sWindowObj);
mInstance = NULL;
/*
if (mControlsScriptablePeer != NULL) {
mControlsScriptablePeer->SetInstance(NULL);
mControlsScriptablePeer->Release();
NS_IF_RELEASE(mControlsScriptablePeer);
}
*/
// clearPreference(this, "general.useragent.override");
if (m_pScriptableObjectControls) {
NPN_ReleaseObject(m_pScriptableObjectControls);
}
if (m_pScriptableObject) {
NPN_ReleaseObject(m_pScriptableObject);
}
}
NPBool CPlugin::init(NPWindow * pNPWindow)
{
if (pNPWindow == NULL)
return FALSE;
m_Window = pNPWindow;
mInitialized = TRUE;
return mInitialized;
}
int16 CPlugin::handleEvent(void *event)
{
#ifdef XP_MAC
NPEvent *ev = (NPEvent *) event;
if (m_Window) {
Rect box = { m_Window->y, m_Window->x,
m_Window->y + m_Window->height, m_Window->x + m_Window->width
};
if (ev->what == updateEvt) {
::TETextBox(m_String, strlen(m_String), &box, teJustCenter);
}
}
#endif
return 0;
}
NPError CPlugin::SetWindow(NPWindow * aWindow)
{
GError *error = NULL;
gchar *argvn[255];
gint arg = 0;
gint ok;
ListItem *item;
gchar *app_name;
if (!acceptdata)
return NPERR_NO_ERROR;
if (aWindow == NULL)
return NPERR_NO_ERROR;
mX = aWindow->x;
mY = aWindow->y;
mWidth = aWindow->width;
mHeight = aWindow->height;
if (mWindow != (Window) aWindow->window) {
mWindow = (Window) aWindow->window;
NPSetWindowCallbackStruct *ws_info = (NPSetWindowCallbackStruct *) aWindow->ws_info;
}
if (player_launched && mWidth > 0 && mHeight > 0) {
resize_window(this, NULL, mWidth, mHeight);
}
if (!player_launched && mWidth > 0 && mHeight > 0) {
app_name = NULL;
if (player_backend != NULL) {
app_name = g_find_program_in_path(player_backend);
}
if (app_name == NULL) {
app_name = g_find_program_in_path("gnome-mplayer");
if (app_name == NULL)
app_name = g_find_program_in_path("gnome-mplayer-minimal");
}
argvn[arg++] = g_strdup_printf("%s", app_name);
argvn[arg++] = g_strdup_printf("--window=%i", (gint) mWindow);
argvn[arg++] = g_strdup_printf("--controlid=%i", controlid);
argvn[arg++] = g_strdup_printf("--width=%i", mWidth);
argvn[arg++] = g_strdup_printf("--height=%i", mHeight);
argvn[arg++] = g_strdup_printf("--autostart=%i", autostart);
argvn[arg++] = g_strdup_printf("--showcontrols=%i", show_controls);
if (disable_context_menu == TRUE)
argvn[arg++] = g_strdup_printf("--disablecontextmenu");
if (disable_fullscreen == TRUE)
argvn[arg++] = g_strdup_printf("--disablefullscreen");
if (debug == TRUE)
argvn[arg++] = g_strdup_printf("--verbose");
if (name != NULL)
argvn[arg++] = g_strdup_printf("--rpname=%s", name);
if (console != NULL)
argvn[arg++] = g_strdup_printf("--rpconsole=%s", console);
if (controls != NULL) {
argvn[arg++] = g_strdup_printf("--rpcontrols=%s", controls);
}
if (tv_device != NULL) {
argvn[arg++] = g_strdup_printf("--tvdevice=%s", tv_device);
}
if (tv_driver != NULL) {
argvn[arg++] = g_strdup_printf("--tvdriver=%s", tv_driver);
}
if (tv_input != NULL) {
argvn[arg++] = g_strdup_printf("--tvinput=%s", tv_input);
}
if (tv_width > 0) {
argvn[arg++] = g_strdup_printf("--tvwidth=%i", tv_width);
}
if (tv_height > 0) {
argvn[arg++] = g_strdup_printf("--tvheight=%i", tv_height);
}
argvn[arg] = NULL;
playerready = FALSE;
ok = g_spawn_async(NULL, argvn, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error);
if (ok) {
player_launched = TRUE;
} else {
gm_log(debug_level, G_LOG_LEVEL_INFO, "Unable to launch %s: %s\n", app_name,
error->message);
g_error_free(error);
error = NULL;
}
g_free(app_name);
if (post_dom_events && id != NULL) {
postDOMEvent(mInstance, id, "qt_begin");
}
//postPlayStateChange(mInstance, STATE_READY);
}
if (playlist != NULL) {
item = (ListItem *) playlist->data;
if (item && !item->play)
item = list_find_next_playable(playlist);
if (item && !item->requested) {
item->cancelled = FALSE;
if (item->streaming) {
gm_log(debug_level, G_LOG_LEVEL_INFO,
"Calling open_location with item = %p src = %s\n", item, item->src);
open_location(this, item, FALSE);
item->requested = 1;
} else {
item->requested = 1;
gm_log(debug_level, G_LOG_LEVEL_INFO,
"Calling GetURLNotify with item = %p src = %s\n", item, item->src);
this->GetURLNotify(mInstance, item->src, NULL, item);
}
}
}
return NPERR_NO_ERROR;
}
void CPlugin::shut()
{
ListItem *item;
GList *iter;
acceptdata = FALSE;
mInitialized = FALSE;
if (playlist != NULL) {
for (iter = playlist; iter != NULL; iter = g_list_next(iter)) {
item = (ListItem *) iter->data;
if (item != NULL) {
item->cancelled = TRUE;
if (item->controlid != 0) {
send_signal_when_ready(this, item, "Terminate");
}
}
}
}
send_signal_when_ready(this, NULL, "Terminate");
playerready = FALSE;
playlist = list_clear(playlist);
if (event_destroy != NULL) {
NPN_GetURL(mInstance, event_destroy, NULL);
}
if (connection != NULL) {
connection = dbus_unhook(connection, this);
}
}
NPBool CPlugin::isInitialized()
{
return mInitialized;
}
NPError CPlugin::NewStream(NPMIMEType type, NPStream * stream, NPBool seekable, uint16 * stype)
{
if (g_strrstr(stream->url, "javascript") == NULL) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "New Stream Requested - %s\n", stream->url);
}
if (g_strrstr(stream->url, "javascript") == NULL && stream->notifyData == NULL) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "item is NULL for %s\n", stream->url);
}
return NPERR_NO_ERROR;
}
NPError CPlugin::DestroyStream(NPStream * stream, NPError reason)
{
ListItem *item;
ListItem *fetch_item;
gchar *text;
gboolean fetch_next = TRUE;
if (g_strrstr(stream->url, "javascript") == NULL)
gm_log(debug_level, G_LOG_LEVEL_MESSAGE, "Entering destroy stream reason = %i - %s for %s",
reason, NPErrorToString(reason), stream->url);
if (reason == NPERR_NO_ERROR) {
item = (ListItem *) stream->notifyData;
// item = list_find(playlist, (gchar*)stream->url);
if (item == NULL) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "Leaving destroy stream - item not found");
return NPERR_NO_ERROR;
}
if (item->localfp) {
fclose(item->localfp);
item->retrieved = TRUE;
item->localfp = 0;
send_signal_with_double(this, item, "SetCachePercent", 1.0);
text = g_strdup_printf(_("Cache fill: %2.2f%%"), 100.0);
send_signal_with_string(this, item, "SetProgressText", text);
g_free(text);
}
if (!item->opened && item->play) {
gm_log(debug_level, G_LOG_LEVEL_MESSAGE, "item '%s' is not opened and is playable",
item->src);
if (!item->streaming)
item->streaming = streaming(item->src);
if (!item->streaming) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "in Destroy Stream");
playlist = list_parse_qt(playlist, item, FALSE);
playlist = list_parse_qt2(playlist, item, FALSE);
playlist = list_parse_asx(playlist, item, FALSE);
playlist = list_parse_qml(playlist, item, FALSE);
playlist = list_parse_ram(playlist, item, FALSE);
}
if (item->playlist == FALSE) {
if (item != NULL && item->queuedtoplay == FALSE) {
if (!list_item_opened(playlist)) {
item = list_find_first_playable(playlist);
}
}
if (item != NULL) {
if (item->play == TRUE && item->opened == FALSE) {
open_location(this, item, TRUE);
if (post_dom_events && this->id != NULL) {
postDOMEvent(mInstance, this->id, "qt_play");
}
}
}
} else {
item = list_find_first_playable(playlist);
if (item != NULL) {
if (!item->streaming) {
if (item->requested == FALSE) {
gm_log(debug_level, G_LOG_LEVEL_INFO, "Getting URL '%s'", item->src);
item->requested = TRUE;
this->GetURLNotify(mInstance, item->src, NULL, item);
fetch_next = FALSE;
}
} else {
if (!list_item_opened(playlist))
open_location(this, item, FALSE);
}
}
}
// fetch the next item on the playlist
if (fetch_next) {
fetch_item = list_find_next_playable_after_listitem(playlist, item);
if (fetch_item != NULL) {
if (!fetch_item->streaming) {
gm_log(debug_level, G_LOG_LEVEL_INFO, "Prefetching URL '%s'", fetch_item->src);
fetch_item->requested = TRUE;
this->GetURLNotify(mInstance, fetch_item->src, NULL, fetch_item);
}
}
}
}
} else if (reason == NPERR_INVALID_URL) {
item = (ListItem *) stream->notifyData;
if (item) {
gm_log(debug_level, G_LOG_LEVEL_INFO, "Destroy Stream, invalid url, item is %s\n",
item->src);
} else {
if (g_strrstr(stream->url, "javascript") == NULL) {
gm_log(debug_level, G_LOG_LEVEL_INFO,
"Destroy Stream, network error, item is NULL\n");
}
}
} else {
item = (ListItem *) stream->notifyData;
// item = list_find(playlist, (gchar*)stream->url);
if (g_strrstr(stream->url, "javascript") == NULL)
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "Exiting destroy stream reason = %i for %s\n",
reason, stream->url);
if (item == NULL) {
return NPERR_NO_ERROR;
} else {
if (post_dom_events && this->id != NULL) {
postDOMEvent(mInstance, this->id, "qt_load");
}
postPlayStateChange(mInstance, STATE_TRANSITIONING);
}
if (item->localfp) {
fclose(item->localfp);
item->retrieved = FALSE;
item->localfp = 0;
}
}
gm_log(debug_level, G_LOG_LEVEL_INFO,
"Leaving DestroyStream for %s and the playlist looks like this", stream->url);
list_dump(playlist);
return NPERR_NO_ERROR;
}
void CPlugin::URLNotify(const char *url, NPReason reason, void *notifyData)
{
ListItem *item = (ListItem *) notifyData;
gm_log(debug_level, G_LOG_LEVEL_MESSAGE, "URL Notify url = '%s'\nreason = %i - %s\n%s\n%s\n%s",
url, reason, NPReasonToString(reason), item->src, item->local, path);
if (reason == NPRES_DONE) {
// done
} else if (reason == NPRES_NETWORK_ERR) {
// error
} else if (reason == NPRES_USER_BREAK) {
// user cancelled
} else {
// something else
}
}
int32 CPlugin::WriteReady(NPStream * stream)
{
ListItem *item;
gchar *path;
gchar *tmp;
// printf("WriteReady called\n");
if (!acceptdata) {
gm_log(debug_level, G_LOG_LEVEL_INFO, "Not accepting data\n");
NPN_DestroyStream(mInstance, stream, NPERR_GENERIC_ERROR);
return -1;
}
item = (ListItem *) stream->notifyData;
// item = list_find(playlist, (gchar*)stream->url);
if (item == NULL) {
if (mode == NP_FULL) {
return -1;
} else {
gm_log(debug_level, G_LOG_LEVEL_INFO, "item is null\nstream url %s\n", stream->url);
NPN_DestroyStream(mInstance, stream, NPERR_NO_ERROR);
return -1;
}
} else {
if (g_ascii_strcasecmp(item->src, stream->url) != 0) {
g_strlcpy(item->src, stream->url, 4096);
}
}
// printf("Write Ready item url = %s\n%s\n",item->src,stream->url);
if (item->cancelled) {
gm_log(debug_level, G_LOG_LEVEL_INFO, "cancelling WriteReady\n");
NPN_DestroyStream(mInstance, stream, NPERR_NO_ERROR);
return -1;
}
if (strlen(item->local) == 0) {
path = g_strdup_printf("%s/gnome-mplayer/plugin", g_get_user_cache_dir());
if (!g_file_test(path, G_FILE_TEST_IS_DIR)) {
g_mkdir_with_parents(path, 0775);
}
tmp = gm_tempname(path, "gecko-mediaplayerXXXXXX");
g_snprintf(item->local, 1024, "%s", tmp);
g_free(tmp);
g_free(path);
if (strstr(mimetype, "midi") != NULL) {
g_strlcat(item->local, ".mid", 1024);
}
if (strstr(mimetype, "mp3") != NULL) {
g_strlcat(item->local, ".mp3", 1024);
}
if (strstr(mimetype, "audio/mpeg") != NULL) {
g_strlcat(item->local, ".mp3", 1024);
}
if (strstr(mimetype, "audio/x-mod") != NULL) {
g_strlcat(item->local, ".mod", 1024);
}
if (strstr(mimetype, "flac") != NULL) {
g_strlcat(item->local, ".flac", 1024);
}
}
if (item->retrieved) {
gm_log(debug_level, G_LOG_LEVEL_INFO, "Duplicate request, item already retrieved\n");
NPN_DestroyStream(mInstance, stream, NPERR_NO_ERROR);
return -1;
}
return STREAMBUFSIZE;
}
int32 CPlugin::Write(NPStream * stream, int32 offset, int32 len, void *buffer)
{
ListItem *item;
int32 wrotebytes = -1;
gchar *text;
gdouble percent = 0.0;
gdouble rate = 0.0;
gchar *upper = NULL;
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "Write Called\n");
if (!acceptdata) {
gm_log(debug_level, G_LOG_LEVEL_INFO, "not accepting data\n");
NPN_DestroyStream(mInstance, stream, NPERR_NO_ERROR);
return -1;
}
item = (ListItem *) stream->notifyData;
if (item == NULL) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "item is NULL\n");
gm_log(debug_level, G_LOG_LEVEL_INFO, _("Write unable to write because item is NULL\n"));
NPN_DestroyStream(mInstance, stream, NPERR_GENERIC_ERROR);
return -1;
}
if (item->cancelled || item->retrieved) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "cancelled\n");
NPN_DestroyStream(mInstance, stream, NPERR_NO_ERROR);
return -1;
}
upper = g_ascii_strup((char *) buffer, len);
if (strstr((char *) buffer, "ICY 200 OK") != NULL
|| strstr((char *) buffer, "Content-length:") != NULL
|| (upper != NULL && strstr(upper, "") != NULL) || item->streaming == TRUE
|| strstr(item->src, "file://") != NULL) {
item->streaming = TRUE;
open_location(this, item, FALSE);
if (post_dom_events && this->id != NULL) {
postDOMEvent(mInstance, this->id, "qt_play");
}
item->requested = TRUE;
if (item->localfp) {
fclose(item->localfp);
}
gm_log(debug_level, G_LOG_LEVEL_INFO, "Got IceCast Stream, let mplayer stream it\n");
NPN_DestroyStream(mInstance, stream, NPERR_NO_ERROR);
return -1;
}
if (upper != NULL) {
g_free(upper);
upper = NULL;
}
if ((!item->localfp) && (!item->retrieved)) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "opening %s for localcache\n", item->local);
item->localfp = fopen(item->local, "w+");
}
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "Write item url = %s\n", item->src);
if (item->localfp == NULL) {
gm_log(debug_level, G_LOG_LEVEL_INFO, "Local cache file is not open, cannot write data\n");
NPN_DestroyStream(mInstance, stream, NPERR_GENERIC_ERROR);
return -1;
}
fseek(item->localfp, offset, SEEK_SET);
wrotebytes = fwrite(buffer, 1, len, item->localfp);
item->localsize += wrotebytes;
if (item->mediasize != stream->end)
item->mediasize = stream->end;
if (playerready) {
percent = 0.0;
if (item->mediasize > 0) {
percent = (gdouble) item->localsize / (gdouble) item->mediasize;
if (difftime(time(NULL), lastupdate) > 0.5) {
send_signal_with_double(this, item, "SetCachePercent", percent);
rate =
(gdouble) ((item->localsize -
item->lastsize) / 1024.0) / (gdouble) difftime(time(NULL),
lastupdate);
if (percent > 0.99) {
text =
g_strdup_printf(_("Caching %iK (%0.1f K/s)"), item->mediasize / 1024, rate);
} else {
text =
g_strdup_printf(_("Cache fill: %2.2f%% (%0.1f K/s)"), percent * 100.0,
rate);
}
send_signal_with_string(this, item, "SetProgressText", text);
if (!item->opened)
send_signal_with_string(this, item, "SetURL", item->src);
if (post_dom_events && this->id != NULL) {
postDOMEvent(mInstance, this->id, "qt_progress");
postDOMEvent(mInstance, this->id, "qt_durationchange");
}
postPlayStateChange(mInstance, STATE_BUFFERING);
time(&lastupdate);
item->lastsize = item->localsize;
}
}
if (!item->opened) {
if ((item->localsize >= (cache_size * 1024)) && (percent >= 0.2)) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "Setting to play because %i > %i\n",
item->localsize, cache_size * 1024);
item->oktoplay = TRUE;
}
if (item->oktoplay == FALSE && (item->localsize > (cache_size * 2 * 1024))
&& (cache_size >= 512)) {
// printf("Setting to play because %i > %i (double cache)\n", item->localsize,
// cache_size * 2 * 1024);
item->oktoplay = TRUE;
}
if (item->oktoplay == FALSE) {
if (item->bitrate == 0 && item->bitrate_requests < 5
&& ((gint) (percent * 100) > item->bitrate_requests)) {
item->bitrate = request_bitrate(this, item, item->local);
item->bitrate_requests++;
}
if (item->bitrate > 0) {
if (item->localsize / item->bitrate >= 10 && (percent >= 0.2)) {
// printf("Setting to play because %i >= 10\n",
// item->localsize / item->bitrate);
item->oktoplay = TRUE;
if (post_dom_events && this->id != NULL) {
postDOMEvent(mInstance, this->id, "qt_canplay");
}
}
}
}
}
// item->playlist may have been set on an earlier pass, so do not bother
// checking for playlist again, if it is true.
if (!item->opened && item->play && item->oktoplay && !item->playlist) {
gm_log(debug_level, G_LOG_LEVEL_MESSAGE, "item '%s' is not opened and is playable",
item->src);
if (!item->streaming)
item->streaming = streaming(item->src);
if (!item->streaming) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "in Write");
// we want to detect a playlist, but not add any items to the actual playlist
// if we find them
playlist = list_parse_qt(playlist, item, TRUE);
playlist = list_parse_qt2(playlist, item, TRUE);
playlist = list_parse_asx(playlist, item, TRUE);
playlist = list_parse_qml(playlist, item, TRUE);
playlist = list_parse_ram(playlist, item, TRUE);
}
gm_log(debug_level, G_LOG_LEVEL_MESSAGE, "Write item (%s) playlist = %i", item->src, item->playlist);
if (item->playlist == FALSE) {
// queuedtoplay is only true on a item when the player has requested the
// next item to play. So the rule is this
/*
1. Automatically play only the first playable item on the playlist
2. Play queuedtoplay items when they are playable and not opened
*/
if (item->queuedtoplay == FALSE) {
if (!list_item_opened(playlist)) {
item = list_find_first_playable(playlist);
}
if (item->play == TRUE && item->opened == FALSE) {
open_location(this, item, TRUE);
if (post_dom_events && this->id != NULL) {
postDOMEvent(mInstance, this->id, "qt_play");
}
}
}
}
}
}
return wrotebytes;
}
void CPlugin::Play()
{
send_signal(this, this->lastopened, "Play");
if (post_dom_events && this->id != NULL) {
postDOMEvent(mInstance, this->id, "qt_play");
}
}
void CPlugin::Pause()
{
send_signal(this, this->lastopened, "Pause");
if (post_dom_events && this->id != NULL) {
postDOMEvent(mInstance, this->id, "qt_pause");
}
}
void CPlugin::Stop()
{
send_signal(this, this->lastopened, "Stop");
}
void CPlugin::FastForward()
{
send_signal(this, this->lastopened, "FastForward");
postPlayStateChange(mInstance, STATE_SCANFORWARD);
}
void CPlugin::FastReverse()
{
send_signal(this, this->lastopened, "FastReverse");
postPlayStateChange(mInstance, STATE_SCANREVERSE);
}
void CPlugin::Seek(double counter)
{
send_signal_with_double(this, this->lastopened, "Seek", counter);
}
void CPlugin::SetShowControls(bool value)
{
send_signal_with_boolean(this, this->lastopened, "SetShowControls", value);
}
void CPlugin::SetFullScreen(bool value)
{
send_signal_with_boolean(this, this->lastopened, "SetFullScreen", value);
}
void CPlugin::SetVolume(double value)
{
send_signal_with_double(this, this->lastopened, "Volume", value);
if (post_dom_events && this->id != NULL) {
postDOMEvent(mInstance, this->id, "qt_volumechange");
}
}
void CPlugin::GetVolume(double *_retval)
{
*_retval = request_double_value(this, this->lastopened, "GetVolume");
}
void CPlugin::GetFullScreen(bool * _retval)
{
*_retval = request_boolean_value(this, this->lastopened, "GetFullScreen");
}
void CPlugin::GetShowControls(bool * _retval)
{
*_retval = request_boolean_value(this, this->lastopened, "GetShowControls");
}
void CPlugin::GetTime(double *_retval)
{
*_retval = request_double_value(this, this->lastopened, "GetTime");
}
void CPlugin::GetDuration(double *_retval)
{
*_retval = request_double_value(this, this->lastopened, "GetDuration");
}
void CPlugin::GetPercent(double *_retval)
{
*_retval = request_double_value(this, this->lastopened, "GetPercent");
}
void CPlugin::GetBitrate(int *_retval)
{
*_retval = request_int_value(this, this->lastopened, "GetBitrate");
}
void CPlugin::SetFilename(const char *filename)
{
ListItem *item;
if (filename == NULL)
return;
item = g_new0(ListItem, 1);
g_strlcpy(item->src, filename, 1024);
item->streaming = streaming(item->src);
item->play = TRUE;
item->id = nextid++;
playlist = g_list_append(playlist, item);
send_signal(this, this->lastopened, "Quit");
if (item->streaming) {
open_location(this, item, FALSE);
item->requested = 1;
} else {
item->requested = 1;
this->GetURLNotify(mInstance, item->src, NULL, item);
}
}
void CPlugin::GetFilename(char **filename)
{
ListItem *item = NULL;
if (this->lastopened != NULL) {
*filename = g_strdup(this->lastopened->src);
} else {
if (playlist != NULL)
item = (ListItem *) playlist->data;
if (item != NULL) {
*filename = g_strdup(item->src);
} else {
*filename = NULL;
}
}
}
void CPlugin::GetMIMEType(char **_retval)
{
*_retval = g_strdup(mimetype);
}
void CPlugin::GetPlayState(PRInt32 * playstate)
{
*playstate = request_int_value(this, this->lastopened, "GetPlayState");
}
void CPlugin::GetLoop(bool * _retval)
{
if (lastopened != NULL) {
*_retval = (bool) lastopened->loop;
} else {
*_retval = FALSE;
}
}
void CPlugin::SetLoop(bool value)
{
if (lastopened != NULL) {
lastopened->loop = (int) value;
lastopened->loopcount = -1;
}
}
void CPlugin::PlayPause()
{
gint state;
state = request_int_value(this, this->lastopened, "GetPlayState");
if (state == STATE_PAUSED) {
send_signal(this, this->lastopened, "Play");
}
if (state == STATE_PLAYING) {
send_signal(this, this->lastopened, "Pause");
}
}
void CPlugin::SetOnClick(const char *event)
{
if (event_mouseclicked != NULL) {
g_free(event_mouseclicked);
}
if (g_ascii_strncasecmp(event, "javascript:", 11) == 0) {
event_mouseclicked = g_strdup_printf("%s", event);
} else {
event_mouseclicked = g_strdup_printf("javascript:%s", event);
}
}
void CPlugin::SetOnMediaComplete(const char *event)
{
if (event_mediacomplete != NULL) {
g_free(event_mediacomplete);
}
if (g_ascii_strncasecmp(event, "javascript:", 11) == 0) {
event_mediacomplete = g_strdup_printf("%s", event);
} else {
event_mediacomplete = g_strdup_printf("javascript:%s", event);
}
}
void CPlugin::SetOnMouseUp(const char *event)
{
if (event_mouseup != NULL) {
g_free(event_mouseup);
}
if (g_ascii_strncasecmp(event, "javascript:", 11) == 0) {
event_mouseup = g_strdup_printf("%s", event);
} else {
event_mouseup = g_strdup_printf("javascript:%s", event);
}
}
void CPlugin::SetOnMouseDown(const char *event)
{
if (event_mousedown != NULL) {
g_free(event_mousedown);
}
if (g_ascii_strncasecmp(event, "javascript:", 11) == 0) {
event_mousedown = g_strdup_printf("%s", event);
} else {
event_mousedown = g_strdup_printf("javascript:%s", event);
}
}
void CPlugin::SetOnMouseOut(const char *event)
{
if (event_leavewindow != NULL) {
g_free(event_leavewindow);
}
if (g_ascii_strncasecmp(event, "javascript:", 11) == 0) {
event_leavewindow = g_strdup_printf("%s", event);
} else {
event_leavewindow = g_strdup_printf("javascript:%s", event);
}
}
void CPlugin::SetOnMouseOver(const char *event)
{
if (event_enterwindow != NULL) {
g_free(event_enterwindow);
}
if (g_ascii_strncasecmp(event, "javascript:", 11) == 0) {
event_enterwindow = g_strdup_printf("%s", event);
} else {
event_enterwindow = g_strdup_printf("javascript:%s", event);
}
}
void CPlugin::SetOnDestroy(const char *event)
{
if (event_destroy != NULL) {
g_free(event_destroy);
}
if (g_ascii_strncasecmp(event, "javascript:", 11) == 0) {
event_destroy = g_strdup_printf("%s", event);
} else {
event_destroy = g_strdup_printf("javascript:%s", event);
}
}
#ifdef HAVE_CURL
int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
{
ListItem *item = (ListItem *) clientp;
gdouble percent, rate;
gchar *text;
gboolean ok_to_play = FALSE;
gint id;
gboolean ready;
gboolean newwindow;
CPlugin *plugin = (CPlugin *) item->plugin;
gchar *path;
// skip divide by zero issues
if (dltotal == 0)
return 0; // keeps downloading
if (item->cancelled) {
gm_log(plugin->debug_level, G_LOG_LEVEL_DEBUG, "cancelling download at %f for %s\n", dlnow,
item->src);
return -1; // cancels download
}
//printf("item ready = %i,player ready = %i,%f,%f,%f\n", item->playerready, plugin->playerready,
// dlnow, dltotal, dlnow / dltotal);
item->localsize = dlnow;
if (item->mediasize != dltotal)
item->mediasize = dltotal;
if (plugin->playerready) {
percent = 0.0;
if (item->mediasize > 0) {
percent = (gdouble) item->localsize / (gdouble) item->mediasize;
if (difftime(time(NULL), plugin->lastupdate) > 0.5) {
gm_log(plugin->debug_level, G_LOG_LEVEL_INFO, "updating display id = %i\n",
item->id);
send_signal_with_double(plugin, item, "SetCachePercent", percent);
rate =
(gdouble) ((item->localsize -
item->lastsize) / 1024.0) / (gdouble) difftime(time(NULL),
plugin->lastupdate);
if (percent > 0.99) {
text =
g_strdup_printf(_("Caching %iK (%0.1f K/s)"), item->mediasize / 1024, rate);
} else {
text =
g_strdup_printf(_("Cache fill: %2.2f%% (%0.1f K/s)"), percent * 100.0,
rate);
}
send_signal_with_string(plugin, item, "SetProgressText", text);
if (!item->opened) {
//open_location (plugin, item, TRUE);
//item->opened = TRUE;
//send_signal_with_string(plugin, item, "SetURL", item->src);
}
if (plugin->post_dom_events && plugin->id != NULL) {
postDOMEvent(plugin->mInstance, plugin->id, "qt_progress");
postDOMEvent(plugin->mInstance, plugin->id, "qt_durationchange");
}
postPlayStateChange(plugin->mInstance, STATE_BUFFERING);
time(&(plugin->lastupdate));
item->lastsize = item->localsize;
}
}
}
return 0;
}
gpointer CURLGetURLNotify(gpointer data)
{
ListItem *item = (ListItem *) data;
ListItem *fetch_item = NULL;
CPlugin *plugin = (CPlugin *) item->plugin;
FILE *local;
CURL *curl;
if (item) {
local = fopen(item->local, "wb");
if (local) {
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, item->src);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, local);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "QuickTime/7.6.9");
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, item);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
curl_easy_perform(curl);
curl_easy_cleanup(curl);
gm_log(plugin->debug_level, G_LOG_LEVEL_INFO, "item retrieved using CURL\n");
//plugin->URLNotify(item->src, NPRES_DONE, item);
}
fclose(local);
gm_log(plugin->debug_level, G_LOG_LEVEL_DEBUG, "fetched %s to %s opened = %i\n",
item->src, item->local, item->opened);
send_signal_with_double(plugin, item, "SetCachePercent", 1.0);
send_signal_with_double(plugin, item, "SetCachePercent", 0.0);
item->retrieved = TRUE;
}
if (!item->opened) {
if (!item->streaming)
item->streaming = streaming(item->src);
if (!item->streaming) {
gm_log(plugin->debug_level, G_LOG_LEVEL_DEBUG, "in CURLGetURLNotify\n");
plugin->playlist = list_parse_qt(plugin->playlist, item, FALSE);
plugin->playlist = list_parse_qt2(plugin->playlist, item, FALSE);
plugin->playlist = list_parse_asx(plugin->playlist, item, FALSE);
plugin->playlist = list_parse_qml(plugin->playlist, item, FALSE);
plugin->playlist = list_parse_ram(plugin->playlist, item, FALSE);
}
// printf("item->play = %i\n", item->play);
// printf("item->src = %i\n", item->src);
// printf("calling open_location from CURLGetURLNotify\n");
if (item->playlist == FALSE) {
if (item != NULL && item->queuedtoplay == FALSE) {
if (!list_item_opened(plugin->playlist)) {
item = list_find_first_playable(plugin->playlist);
}
}
if (item != NULL) {
if (item->play == TRUE && item->opened == FALSE) {
open_location(plugin, item, TRUE);
if (plugin->post_dom_events && plugin->id != NULL) {
postDOMEvent(plugin->mInstance, plugin->id, "qt_loadedfirstframe");
postDOMEvent(plugin->mInstance, plugin->id, "qt_canplay");
postDOMEvent(plugin->mInstance, plugin->id, "qt_play");
}
}
}
} else {
item = list_find_first_playable(plugin->playlist);
if (item != NULL) {
if (!item->streaming) {
if (item->requested == FALSE) {
gm_log(plugin->debug_level, G_LOG_LEVEL_INFO, "Getting URL '%s'",
item->src);
item->requested = TRUE;
plugin->GetURLNotify(plugin->mInstance, item->src, NULL, item);
}
} else {
if (!list_item_opened(plugin->playlist))
open_location(plugin, item, FALSE);
}
}
}
// fetch the next item on the playlist
fetch_item = list_find_next_playable_after_listitem(plugin->playlist, item);
if (fetch_item != NULL) {
if (!fetch_item->streaming) {
gm_log(plugin->debug_level, G_LOG_LEVEL_INFO, "Getting URL '%s'",
fetch_item->src);
fetch_item->requested = TRUE;
CURLGetURLNotify(fetch_item);
}
}
}
}
return NULL;
}
#endif
NPError CPlugin::GetURLNotify(NPP instance, const char *url, const char *target, void *notifyData)
{
#ifdef HAVE_CURL
ListItem *item;
gchar *path;
gchar *tmp;
#endif
if (g_strrstr(url, "apple.com") == NULL /* && this->quicktime_emulation == 0 */ ) {
return NPN_GetURLNotify(instance, url, target, notifyData);
} else {
#ifdef HAVE_CURL
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "using curl to retrieve data from apple.com site\n");
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "quicktime_emulation = %i\n", quicktime_emulation);
item = (ListItem *) notifyData;
// item = list_find(playlist, (gchar*)stream->url);
if (item == NULL) {
if (this->mode == NP_FULL) {
// printf("adding new item %s\n",stream->url);
item = g_new0(ListItem, 1);
g_strlcpy(item->src, url, 1024);
item->requested = TRUE;
item->play = TRUE;
if (!item->streaming)
item->streaming = streaming(item->src);
playlist = g_list_append(playlist, item);
notifyData = item;
} else {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "item is null\nstream url %s\n", url);
return -1;
}
} else {
if (g_ascii_strcasecmp(item->src, url) != 0) {
g_strlcpy(item->src, url, 4096);
}
}
if (item->cancelled) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "item has been cancelled\n");
return -1;
}
if (strlen(item->local) == 0) {
path = g_strdup_printf("%s/gnome-mplayer/plugin", g_get_user_cache_dir());
if (!g_file_test(path, G_FILE_TEST_IS_DIR)) {
g_mkdir_with_parents(path, 0775);
}
tmp = gm_tempname(path, "gecko-mediaplayerXXXXXX");
g_snprintf(item->local, 1024, "%s", tmp);
g_free(tmp);
g_free(path);
}
if (item->retrieved) {
gm_log(debug_level, G_LOG_LEVEL_DEBUG, "item is already retrieved\n");
return -1;
}
item->plugin = (void *) this;
g_thread_create(CURLGetURLNotify, item, FALSE, NULL);
return NPERR_NO_ERROR;
#else
printf
("Unable to set user agent for pulling data from apple.com, request will probably fail\n");
return NPN_GetURLNotify(instance, url, target, notifyData);
#endif
}
}
// ==============================
// ! Scriptability related code !
// ==============================
//
// here the plugin is asked by Mozilla to tell if it is scriptable
// we should return a valid interface id and a pointer to
// nsScriptablePeer interface which we should have implemented
// and which should be defined in the corressponding *.xpt file
// in the bin/components folder
class ScriptablePluginObjectBase:public NPObject {
public:
ScriptablePluginObjectBase(NPP npp):mNpp(npp) {
};
virtual ~ ScriptablePluginObjectBase() {
};
// Virtual NPObject hooks called through this base class. Override
// as you see fit.
virtual void Invalidate();
virtual bool HasMethod(NPIdentifier name);
virtual bool Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result);
virtual bool InvokeDefault(const NPVariant * args, uint32_t argCount, NPVariant * result);
virtual bool HasProperty(NPIdentifier name);
virtual bool GetProperty(NPIdentifier name, NPVariant * result);
virtual bool SetProperty(NPIdentifier name, const NPVariant * value);
virtual bool RemoveProperty(NPIdentifier name);
public:
static void _Deallocate(NPObject * npobj);
static void _Invalidate(NPObject * npobj);
static bool _HasMethod(NPObject * npobj, NPIdentifier name);
static bool _Invoke(NPObject * npobj, NPIdentifier name,
const NPVariant * args, uint32_t argCount, NPVariant * result);
static bool _InvokeDefault(NPObject * npobj, const NPVariant * args,
uint32_t argCount, NPVariant * result);
static bool _HasProperty(NPObject * npobj, NPIdentifier name);
static bool _GetProperty(NPObject * npobj, NPIdentifier name, NPVariant * result);
static bool _SetProperty(NPObject * npobj, NPIdentifier name, const NPVariant * value);
static bool _RemoveProperty(NPObject * npobj, NPIdentifier name);
protected:
NPP mNpp;
};
#define DECLARE_NPOBJECT_CLASS_WITH_BASE(_class, ctor) \
static NPClass s##_class##_NPClass = { \
NP_CLASS_STRUCT_VERSION, \
ctor, \
ScriptablePluginObjectBase::_Deallocate, \
ScriptablePluginObjectBase::_Invalidate, \
ScriptablePluginObjectBase::_HasMethod, \
ScriptablePluginObjectBase::_Invoke, \
ScriptablePluginObjectBase::_InvokeDefault, \
ScriptablePluginObjectBase::_HasProperty, \
ScriptablePluginObjectBase::_GetProperty, \
ScriptablePluginObjectBase::_SetProperty, \
ScriptablePluginObjectBase::_RemoveProperty \
}
#define GET_NPOBJECT_CLASS(_class) &s##_class##_NPClass
void ScriptablePluginObjectBase::Invalidate()
{
}
bool ScriptablePluginObjectBase::HasMethod(NPIdentifier name)
{
return false;
}
bool ScriptablePluginObjectBase::Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result)
{
return false;
}
bool ScriptablePluginObjectBase::InvokeDefault(const NPVariant * args,
uint32_t argCount, NPVariant * result)
{
return false;
}
bool ScriptablePluginObjectBase::HasProperty(NPIdentifier name)
{
return false;
}
bool ScriptablePluginObjectBase::GetProperty(NPIdentifier name, NPVariant * result)
{
VOID_TO_NPVARIANT(*result);
return false;
}
bool ScriptablePluginObjectBase::SetProperty(NPIdentifier name, const NPVariant * value)
{
return false;
}
bool ScriptablePluginObjectBase::RemoveProperty(NPIdentifier name)
{
return false;
}
// static
void ScriptablePluginObjectBase::_Deallocate(NPObject * npobj)
{
// Call the virtual destructor.
delete(ScriptablePluginObjectBase *) npobj;
}
// static
void ScriptablePluginObjectBase::_Invalidate(NPObject * npobj)
{
((ScriptablePluginObjectBase *) npobj)->Invalidate();
}
// static
bool ScriptablePluginObjectBase::_HasMethod(NPObject * npobj, NPIdentifier name)
{
return ((ScriptablePluginObjectBase *) npobj)->HasMethod(name);
}
// static
bool ScriptablePluginObjectBase::_Invoke(NPObject * npobj, NPIdentifier name,
const NPVariant * args, uint32_t argCount,
NPVariant * result)
{
return ((ScriptablePluginObjectBase *) npobj)->Invoke(name, args, argCount, result);
}
// static
bool ScriptablePluginObjectBase::_InvokeDefault(NPObject * npobj,
const NPVariant * args,
uint32_t argCount, NPVariant * result)
{
return ((ScriptablePluginObjectBase *) npobj)->InvokeDefault(args, argCount, result);
}
// static
bool ScriptablePluginObjectBase::_HasProperty(NPObject * npobj, NPIdentifier name)
{
return ((ScriptablePluginObjectBase *) npobj)->HasProperty(name);
}
// static
bool ScriptablePluginObjectBase::_GetProperty(NPObject * npobj, NPIdentifier name,
NPVariant * result)
{
return ((ScriptablePluginObjectBase *) npobj)->GetProperty(name, result);
}
// static
bool ScriptablePluginObjectBase::_SetProperty(NPObject * npobj, NPIdentifier name,
const NPVariant * value)
{
return ((ScriptablePluginObjectBase *) npobj)->SetProperty(name, value);
}
// static
bool ScriptablePluginObjectBase::_RemoveProperty(NPObject * npobj, NPIdentifier name)
{
return ((ScriptablePluginObjectBase *) npobj)->RemoveProperty(name);
}
class ScriptablePluginObjectControls:public ScriptablePluginObjectBase {
public:
ScriptablePluginObjectControls(NPP npp):ScriptablePluginObjectBase(npp) {
};
virtual bool HasMethod(NPIdentifier name);
virtual bool Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result);
virtual bool InvokeDefault(const NPVariant * args, uint32_t argCount, NPVariant * result);
virtual bool HasProperty(NPIdentifier name);
virtual bool GetProperty(NPIdentifier name, NPVariant * result);
virtual bool SetProperty(NPIdentifier name, const NPVariant * value);
};
static NPObject *AllocateScriptablePluginObjectControls(NPP npp, NPClass * aClass)
{
return new ScriptablePluginObjectControls(npp);
}
DECLARE_NPOBJECT_CLASS_WITH_BASE(ScriptablePluginObjectControls,
AllocateScriptablePluginObjectControls);
bool ScriptablePluginObjectControls::HasMethod(NPIdentifier name)
{
if (name == controls_play_id ||
name == controls_pause_id ||
name == controls_stop_id ||
name == controls_fastForward_id ||
name == controls_fastReverse_id || name == controls_step_id) {
return true;
} else {
return false;
}
}
bool ScriptablePluginObjectControls::Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return PR_FALSE;
}
if (name == controls_play_id) {
pPlugin->Play();
return PR_TRUE;
}
if (name == controls_pause_id) {
pPlugin->Pause();
return PR_TRUE;
}
if (name == controls_stop_id) {
pPlugin->Stop();
return PR_TRUE;
}
return false;
}
bool ScriptablePluginObjectControls::InvokeDefault(const NPVariant * args, uint32_t argCount,
NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG,
"ScriptablePluginObjectControls default method called!\n");
}
STRINGZ_TO_NPVARIANT(strdup("default method return val"), *result);
return PR_TRUE;
}
bool ScriptablePluginObjectControls::HasProperty(NPIdentifier name)
{
if (name == controls_currentPosition_id || name == controls_currentItem_id) {
return true;
} else {
return false;
}
}
bool ScriptablePluginObjectControls::GetProperty(NPIdentifier name, NPVariant * result)
{
double position;
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
VOID_TO_NPVARIANT(*result);
return false;
}
if (name == controls_currentPosition_id) {
pPlugin->GetTime(&position);
DOUBLE_TO_NPVARIANT(position, *result);
return true;
}
if (name == controls_currentItem_id) {
OBJECT_TO_NPVARIANT(pPlugin->GetScriptableObjectMedia(), *result);
return true;
}
VOID_TO_NPVARIANT(*result);
return false;
}
bool ScriptablePluginObjectControls::SetProperty(NPIdentifier name, const NPVariant * value)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return false;
}
if (name == controls_currentPosition_id) {
pPlugin->Seek(NPVARIANT_TO_DOUBLE(*value));
return true;
}
return false;
}
class ScriptablePluginObjectMedia:public ScriptablePluginObjectBase {
public:
ScriptablePluginObjectMedia(NPP npp):ScriptablePluginObjectBase(npp) {
};
virtual bool HasMethod(NPIdentifier name);
virtual bool Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result);
virtual bool InvokeDefault(const NPVariant * args, uint32_t argCount, NPVariant * result);
virtual bool HasProperty(NPIdentifier name);
virtual bool GetProperty(NPIdentifier name, NPVariant * result);
virtual bool SetProperty(NPIdentifier name, const NPVariant * value);
};
static NPObject *AllocateScriptablePluginObjectMedia(NPP npp, NPClass * aClass)
{
return new ScriptablePluginObjectMedia(npp);
}
DECLARE_NPOBJECT_CLASS_WITH_BASE(ScriptablePluginObjectMedia, AllocateScriptablePluginObjectMedia);
bool ScriptablePluginObjectMedia::HasMethod(NPIdentifier name)
{
if (name == media_getItemInfo_id) {
return true;
} else {
return false;
}
}
bool ScriptablePluginObjectMedia::Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
gchar *arg;
int i;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return PR_FALSE;
}
if (name == media_getItemInfo_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
arg = g_strdup(NPVARIANT_TO_STRING(args[0]).UTF8Characters);
#else
arg = g_strdup(NPVARIANT_TO_STRING(args[0]).utf8characters);
#endif
if (g_ascii_strcasecmp(arg, "title") == 0) {
STRINGZ_TO_NPVARIANT(strdup
(request_string_value(pPlugin, pPlugin->lastopened, "GetTitle")),
*result);
} else if (g_ascii_strcasecmp(arg, "uri") == 0) {
STRINGZ_TO_NPVARIANT(strdup
(request_string_value(pPlugin, pPlugin->lastopened, "GetURI")),
*result);
} else if (g_ascii_strcasecmp(arg, "bitrate") == 0) {
pPlugin->GetBitrate(&i);
INT32_TO_NPVARIANT(i, *result);
} else {
STRINGZ_TO_NPVARIANT(strdup("Unknown"), *result);
}
return true;
}
return false;
}
bool ScriptablePluginObjectMedia::InvokeDefault(const NPVariant * args, uint32_t argCount,
NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG,
"ScriptablePluginObjectMedia default method called!\n");
}
STRINGZ_TO_NPVARIANT(strdup("default method return val"), *result);
return PR_TRUE;
}
bool ScriptablePluginObjectMedia::HasProperty(NPIdentifier name)
{
if (name == media_duration_id) {
return true;
} else {
return false;
}
}
bool ScriptablePluginObjectMedia::GetProperty(NPIdentifier name, NPVariant * result)
{
double d;
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
VOID_TO_NPVARIANT(*result);
return false;
}
if (name == media_duration_id) {
pPlugin->GetDuration(&d);
DOUBLE_TO_NPVARIANT(d, *result);
return true;
}
VOID_TO_NPVARIANT(*result);
return false;
}
bool ScriptablePluginObjectMedia::SetProperty(NPIdentifier name, const NPVariant * value)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return false;
}
if (name == media_duration_id) {
return true;
}
return false;
}
class ScriptablePluginObjectSettings:public ScriptablePluginObjectBase {
public:
ScriptablePluginObjectSettings(NPP npp):ScriptablePluginObjectBase(npp) {
};
virtual bool HasMethod(NPIdentifier name);
virtual bool Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result);
virtual bool InvokeDefault(const NPVariant * args, uint32_t argCount, NPVariant * result);
virtual bool HasProperty(NPIdentifier name);
virtual bool GetProperty(NPIdentifier name, NPVariant * result);
virtual bool SetProperty(NPIdentifier name, const NPVariant * value);
};
static NPObject *AllocateScriptablePluginObjectSettings(NPP npp, NPClass * aClass)
{
return new ScriptablePluginObjectSettings(npp);
}
DECLARE_NPOBJECT_CLASS_WITH_BASE(ScriptablePluginObjectSettings,
AllocateScriptablePluginObjectSettings);
bool ScriptablePluginObjectSettings::HasMethod(NPIdentifier name)
{
return false;
}
bool ScriptablePluginObjectSettings::Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return PR_FALSE;
}
return false;
}
bool ScriptablePluginObjectSettings::InvokeDefault(const NPVariant * args, uint32_t argCount,
NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG,
"ScriptablePluginObjectSettings default method called!\n");
}
STRINGZ_TO_NPVARIANT(strdup("default method return val"), *result);
return PR_TRUE;
}
bool ScriptablePluginObjectSettings::HasProperty(NPIdentifier name)
{
if (name == settings_volume_id) {
return true;
} else {
return false;
}
}
bool ScriptablePluginObjectSettings::GetProperty(NPIdentifier name, NPVariant * result)
{
double d;
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
VOID_TO_NPVARIANT(*result);
return false;
}
if (name == settings_volume_id) {
pPlugin->GetVolume(&d);
DOUBLE_TO_NPVARIANT(d, *result);
return true;
}
VOID_TO_NPVARIANT(*result);
return false;
}
bool ScriptablePluginObjectSettings::SetProperty(NPIdentifier name, const NPVariant * value)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return false;
}
if (name == settings_volume_id) {
if ((int) NPVARIANT_TO_DOUBLE(*value) == 0 && NPVARIANT_TO_INT32(*value) > 0) {
pPlugin->SetVolume((double) NPVARIANT_TO_INT32(*value));
} else {
pPlugin->SetVolume(NPVARIANT_TO_DOUBLE(*value));
}
return true;
}
return false;
}
class ScriptablePluginObjectError:public ScriptablePluginObjectBase {
public:
ScriptablePluginObjectError(NPP npp):ScriptablePluginObjectBase(npp) {
};
virtual bool HasMethod(NPIdentifier name);
virtual bool Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result);
virtual bool InvokeDefault(const NPVariant * args, uint32_t argCount, NPVariant * result);
virtual bool HasProperty(NPIdentifier name);
virtual bool GetProperty(NPIdentifier name, NPVariant * result);
virtual bool SetProperty(NPIdentifier name, const NPVariant * value);
};
static NPObject *AllocateScriptablePluginObjectError(NPP npp, NPClass * aClass)
{
return new ScriptablePluginObjectError(npp);
}
DECLARE_NPOBJECT_CLASS_WITH_BASE(ScriptablePluginObjectError, AllocateScriptablePluginObjectError);
bool ScriptablePluginObjectError::HasMethod(NPIdentifier name)
{
return false;
}
bool ScriptablePluginObjectError::Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return PR_FALSE;
}
return false;
}
bool ScriptablePluginObjectError::InvokeDefault(const NPVariant * args, uint32_t argCount,
NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG,
"ScriptablePluginObjectError default method called!\n");
}
STRINGZ_TO_NPVARIANT(strdup("default method return val"), *result);
return PR_TRUE;
}
bool ScriptablePluginObjectError::HasProperty(NPIdentifier name)
{
if (name == error_errorCount_id) {
return true;
} else {
return false;
}
}
bool ScriptablePluginObjectError::GetProperty(NPIdentifier name, NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
VOID_TO_NPVARIANT(*result);
return false;
}
if (name == error_errorCount_id) {
INT32_TO_NPVARIANT(0, *result);
return true;
}
VOID_TO_NPVARIANT(*result);
return false;
}
bool ScriptablePluginObjectError::SetProperty(NPIdentifier name, const NPVariant * value)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return false;
}
if (name == settings_volume_id) {
if ((int) NPVARIANT_TO_DOUBLE(*value) == 0 && NPVARIANT_TO_INT32(*value) > 0) {
pPlugin->SetVolume((double) NPVARIANT_TO_INT32(*value));
} else {
pPlugin->SetVolume(NPVARIANT_TO_DOUBLE(*value));
}
return true;
}
return false;
}
class ScriptablePluginObject:public ScriptablePluginObjectBase {
public:
ScriptablePluginObject(NPP npp):ScriptablePluginObjectBase(npp) {
};
virtual bool HasMethod(NPIdentifier name);
virtual bool Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result);
virtual bool InvokeDefault(const NPVariant * args, uint32_t argCount, NPVariant * result);
virtual bool HasProperty(NPIdentifier name);
virtual bool GetProperty(NPIdentifier name, NPVariant * result);
virtual bool SetProperty(NPIdentifier name, const NPVariant * value);
};
static NPObject *AllocateScriptablePluginObject(NPP npp, NPClass * aClass)
{
return new ScriptablePluginObject(npp);
}
DECLARE_NPOBJECT_CLASS_WITH_BASE(ScriptablePluginObject, AllocateScriptablePluginObject);
bool ScriptablePluginObject::HasMethod(NPIdentifier name)
{
if (name == Play_id ||
name == PlayAt_id ||
name == Pause_id ||
name == PlayPause_id ||
name == Stop_id ||
name == quit_id ||
name == DoPlay_id ||
name == DoPause_id ||
name == FastForward_id ||
name == FastReverse_id ||
name == ff_id ||
name == rew_id ||
name == rewind_id ||
name == Seek_id ||
name == Open_id ||
name == SetVolume_id ||
name == GetVolume_id ||
name == SetFileName_id ||
name == GetFileName_id ||
name == SetIsLooping_id ||
name == GetIsLooping_id ||
name == SetAutoPlay_id ||
name == GetAutoPlay_id ||
name == SetHREF_id ||
name == GetHREF_id ||
name == SetURL_id ||
name == GetURL_id ||
name == GetMIMEType_id ||
name == getTime_id ||
name == getDuration_id ||
name == getPercent_id ||
name == getBitrate_id ||
name == isplaying_id ||
name == playlistAppend_id ||
name == playlistClear_id ||
name == onClick_id ||
name == onMediaComplete_id ||
name == onMouseUp_id ||
name == onMouseDown_id ||
name == onMouseOut_id || name == onMouseOver_id || name == onDestroy_id) {
return true;
} else {
return false;
}
}
bool ScriptablePluginObject::Invoke(NPIdentifier name, const NPVariant * args,
uint32_t argCount, NPVariant * result)
{
double d;
char *s;
bool b;
int i;
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return PR_FALSE;
}
if (name == Play_id || name == DoPlay_id) {
pPlugin->Play();
return PR_TRUE;
}
if (name == PlayAt_id) {
pPlugin->Play();
if ((int) NPVARIANT_TO_DOUBLE(args[0]) == 0 && NPVARIANT_TO_INT32(args[0]) > 0) {
pPlugin->Seek((double) NPVARIANT_TO_INT32(args[0]));
} else {
pPlugin->Seek(NPVARIANT_TO_DOUBLE(args[0]));
}
return PR_TRUE;
}
if (name == Pause_id || name == DoPause_id) {
pPlugin->Pause();
return PR_TRUE;
}
if (name == PlayPause_id) {
pPlugin->PlayPause();
return PR_TRUE;
}
if (name == Stop_id) {
pPlugin->Stop();
return PR_TRUE;
}
if (name == FastForward_id || name == ff_id) {
pPlugin->FastForward();
return PR_TRUE;
}
if (name == FastReverse_id || name == rew_id || name == rewind_id) {
pPlugin->FastReverse();
return PR_TRUE;
}
if (name == Seek_id) {
if ((int) NPVARIANT_TO_DOUBLE(args[0]) == 0 && NPVARIANT_TO_INT32(args[0]) > 0) {
pPlugin->Seek((double) NPVARIANT_TO_INT32(args[0]));
} else {
pPlugin->Seek(NPVARIANT_TO_DOUBLE(args[0]));
}
return PR_TRUE;
}
if (name == Open_id || name == SetFileName_id || name == SetHREF_id || name == SetURL_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
pPlugin->SetFilename(NPVARIANT_TO_STRING(args[0]).UTF8Characters);
#else
pPlugin->SetFilename(NPVARIANT_TO_STRING(args[0]).utf8characters);
#endif
return PR_TRUE;
}
if (name == GetFileName_id || name == GetHREF_id || name == GetURL_id) {
pPlugin->GetFilename(&s);
STRINGZ_TO_NPVARIANT(s, *result);
g_free(s);
return PR_TRUE;
}
if (name == SetVolume_id) {
if ((int) NPVARIANT_TO_DOUBLE(args[0]) == 0 && NPVARIANT_TO_INT32(args[0]) > 0) {
pPlugin->SetVolume((double) NPVARIANT_TO_INT32(args[0]));
} else {
pPlugin->SetVolume(NPVARIANT_TO_DOUBLE(args[0]));
}
return PR_TRUE;
}
if (name == GetVolume_id) {
pPlugin->GetVolume(&d);
DOUBLE_TO_NPVARIANT(d, *result);
return PR_TRUE;
}
if (name == SetIsLooping_id) {
pPlugin->SetLoop(NPVARIANT_TO_BOOLEAN(args[0]));
return PR_TRUE;
}
if (name == GetIsLooping_id) {
pPlugin->GetLoop(&b);
BOOLEAN_TO_NPVARIANT(b, *result);
return PR_TRUE;
}
if (name == SetAutoPlay_id) {
pPlugin->autostart = NPVARIANT_TO_BOOLEAN(args[0]);
return PR_TRUE;
}
if (name == GetAutoPlay_id) {
BOOLEAN_TO_NPVARIANT(pPlugin->autostart, *result);
return PR_TRUE;
}
if (name == GetMIMEType_id) {
pPlugin->GetMIMEType(&s);
STRINGZ_TO_NPVARIANT(s, *result);
g_free(s);
return PR_TRUE;
}
if (name == getTime_id) {
pPlugin->GetTime(&d);
DOUBLE_TO_NPVARIANT(d, *result);
return PR_TRUE;
}
if (name == getDuration_id) {
pPlugin->GetDuration(&d);
DOUBLE_TO_NPVARIANT(d, *result);
return PR_TRUE;
}
if (name == getPercent_id) {
pPlugin->GetPercent(&d);
DOUBLE_TO_NPVARIANT(d, *result);
return PR_TRUE;
}
if (name == getBitrate_id) {
pPlugin->GetBitrate(&i);
INT32_TO_NPVARIANT(i, *result);
return PR_TRUE;
}
if (name == isplaying_id || name == playlistAppend_id || name == playlistClear_id) {
return PR_TRUE;
}
if (name == onClick_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
pPlugin->SetOnClick(NPVARIANT_TO_STRING(args[0]).UTF8Characters);
#else
pPlugin->SetOnClick(NPVARIANT_TO_STRING(args[0]).utf8characters);
#endif
return PR_TRUE;
}
if (name == onMediaComplete_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
pPlugin->SetOnMediaComplete(NPVARIANT_TO_STRING(args[0]).UTF8Characters);
#else
pPlugin->SetOnMediaComplete(NPVARIANT_TO_STRING(args[0]).utf8characters);
#endif
return PR_TRUE;
}
if (name == onMouseUp_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
pPlugin->SetOnMouseUp(NPVARIANT_TO_STRING(args[0]).UTF8Characters);
#else
pPlugin->SetOnMouseUp(NPVARIANT_TO_STRING(args[0]).utf8characters);
#endif
return PR_TRUE;
}
if (name == onMouseDown_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
pPlugin->SetOnMouseDown(NPVARIANT_TO_STRING(args[0]).UTF8Characters);
#else
pPlugin->SetOnMouseDown(NPVARIANT_TO_STRING(args[0]).utf8characters);
#endif
return PR_TRUE;
}
if (name == onMouseOut_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
pPlugin->SetOnMouseOut(NPVARIANT_TO_STRING(args[0]).UTF8Characters);
#else
pPlugin->SetOnMouseOut(NPVARIANT_TO_STRING(args[0]).utf8characters);
#endif
return PR_TRUE;
}
if (name == onMouseOver_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
pPlugin->SetOnMouseOver(NPVARIANT_TO_STRING(args[0]).UTF8Characters);
#else
pPlugin->SetOnMouseOver(NPVARIANT_TO_STRING(args[0]).utf8characters);
#endif
return PR_TRUE;
}
if (name == onDestroy_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
pPlugin->SetOnDestroy(NPVARIANT_TO_STRING(args[0]).UTF8Characters);
#else
pPlugin->SetOnDestroy(NPVARIANT_TO_STRING(args[0]).utf8characters);
#endif
return PR_TRUE;
}
return PR_FALSE;
}
bool ScriptablePluginObject::InvokeDefault(const NPVariant * args, uint32_t argCount,
NPVariant * result)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG,
"ScriptablePluginObject default method called!\n");
}
STRINGZ_TO_NPVARIANT(strdup("default method return val"), *result);
return PR_TRUE;
}
bool ScriptablePluginObject::HasProperty(NPIdentifier name)
{
if (name == filename_id
|| name == src_id
|| name == ShowControls_id
|| name == fullscreen_id
|| name == showlogo_id
|| name == playState_id
|| name == URL_id
|| name == versionInfo_id
|| name == status_id
|| name == controls_id
|| name == media_id
|| name == settings_id
|| name == error_id || name == enabled_id || name == enableContextMenu_id) {
return true;
} else {
return false;
}
}
bool ScriptablePluginObject::GetProperty(NPIdentifier name, NPVariant * result)
{
char *filename;
char *version;
char *status;
bool setting;
PRInt32 state;
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
VOID_TO_NPVARIANT(*result);
return false;
}
if (name == filename_id || name == src_id || name == URL_id) {
pPlugin->GetFilename(&filename);
if (filename != NULL) {
STRINGZ_TO_NPVARIANT(filename, *result);
} else {
STRINGZ_TO_NPVARIANT(strdup(""), *result);
}
return true;
}
if (name == versionInfo_id) {
version = g_strdup("7.0.0.7777");
STRINGZ_TO_NPVARIANT(version, *result);
return true;
}
if (name == ShowControls_id) {
pPlugin->GetShowControls(&setting);
BOOLEAN_TO_NPVARIANT(setting, *result);
return true;
}
if (name == fullscreen_id) {
pPlugin->GetFullScreen(&setting);
BOOLEAN_TO_NPVARIANT(setting, *result);
return true;
}
if (name == showlogo_id) {
setting = true;
BOOLEAN_TO_NPVARIANT(setting, *result);
return true;
}
if (name == playState_id) {
pPlugin->GetPlayState(&state);
INT32_TO_NPVARIANT(state, *result);
return true;
}
if (name == status_id) {
pPlugin->GetPlayState(&state);
switch (state) {
case STATE_PLAYING:
status = g_strdup(_("Playing"));
break;
case STATE_PAUSED:
status = g_strdup(_("Paused"));
break;
case STATE_STOPPED:
status = g_strdup(_("Stopped"));
break;
case STATE_BUFFERING:
status =
g_strdup_printf(_("Buffering %2.1lf%%"),
request_double_value(pPlugin, pPlugin->lastopened,
"GetCachePercent") * 100.0);
break;
default:
status = g_strdup(_("Unknown Status"));
}
// printf("Status = %s\n", status);
STRINGZ_TO_NPVARIANT(status, *result);
return true;
}
if (name == enabled_id) {
BOOLEAN_TO_NPVARIANT(true, *result);
return true;
}
if (name == enableContextMenu_id) {
BOOLEAN_TO_NPVARIANT(!(pPlugin->disable_context_menu), *result);
return true;
}
if (name == controls_id) {
OBJECT_TO_NPVARIANT(pPlugin->GetScriptableObjectControls(), *result);
return true;
}
if (name == media_id) {
OBJECT_TO_NPVARIANT(pPlugin->GetScriptableObjectMedia(), *result);
return true;
}
if (name == settings_id) {
OBJECT_TO_NPVARIANT(pPlugin->GetScriptableObjectSettings(), *result);
return true;
}
if (name == error_id) {
OBJECT_TO_NPVARIANT(pPlugin->GetScriptableObjectError(), *result);
return true;
}
VOID_TO_NPVARIANT(*result);
return false;
}
bool ScriptablePluginObject::SetProperty(NPIdentifier name, const NPVariant * value)
{
CPlugin *pPlugin = (CPlugin *) mNpp->pdata;
if (pPlugin == NULL) {
gm_log(pPlugin->debug_level, G_LOG_LEVEL_DEBUG, "Can't find plugin pointer\n");
return false;
}
if (name == filename_id || name == src_id || name == URL_id) {
#ifdef NPAPI_USE_UPPERCASE_UTF8
pPlugin->SetFilename(NPVARIANT_TO_STRING(*value).UTF8Characters);
#else
pPlugin->SetFilename(NPVARIANT_TO_STRING(*value).utf8characters);
#endif
return true;
}
if (name == ShowControls_id) {
pPlugin->SetShowControls(NPVARIANT_TO_BOOLEAN(*value));
return true;
}
if (name == fullscreen_id) {
pPlugin->SetFullScreen(NPVARIANT_TO_BOOLEAN(*value));
return true;
}
if (name == showlogo_id) {
return true;
}
if (name == playState_id) {
// readonly property
return true;
}
if (name == enabled_id) {
return true;
}
if (name == enableContextMenu_id) {
pPlugin->disable_context_menu = !(NPVARIANT_TO_BOOLEAN(*value));
return true;
}
return false;
}
NPObject *CPlugin::GetScriptableObject()
{
if (!m_pScriptableObject) {
m_pScriptableObject =
NPN_CreateObject(mInstance, GET_NPOBJECT_CLASS(ScriptablePluginObject));
}
if (m_pScriptableObject) {
NPN_RetainObject(m_pScriptableObject);
}
return m_pScriptableObject;
}
NPObject *CPlugin::GetScriptableObjectControls()
{
if (!m_pScriptableObjectControls) {
m_pScriptableObjectControls =
NPN_CreateObject(mInstance, GET_NPOBJECT_CLASS(ScriptablePluginObjectControls));
}
if (m_pScriptableObjectControls) {
NPN_RetainObject(m_pScriptableObjectControls);
}
return m_pScriptableObjectControls;
}
NPObject *CPlugin::GetScriptableObjectMedia()
{
if (!m_pScriptableObjectMedia) {
m_pScriptableObjectMedia =
NPN_CreateObject(mInstance, GET_NPOBJECT_CLASS(ScriptablePluginObjectMedia));
}
if (m_pScriptableObjectMedia) {
NPN_RetainObject(m_pScriptableObjectMedia);
}
return m_pScriptableObjectMedia;
}
NPObject *CPlugin::GetScriptableObjectSettings()
{
if (!m_pScriptableObjectSettings) {
m_pScriptableObjectSettings =
NPN_CreateObject(mInstance, GET_NPOBJECT_CLASS(ScriptablePluginObjectSettings));
}
if (m_pScriptableObjectSettings) {
NPN_RetainObject(m_pScriptableObjectSettings);
}
return m_pScriptableObjectSettings;
}
NPObject *CPlugin::GetScriptableObjectError()
{
if (!m_pScriptableObjectError) {
m_pScriptableObjectError =
NPN_CreateObject(mInstance, GET_NPOBJECT_CLASS(ScriptablePluginObjectError));
}
if (m_pScriptableObjectError) {
NPN_RetainObject(m_pScriptableObjectError);
}
return m_pScriptableObjectError;
}
gecko-mediaplayer-1.0.8/src/plugin_types_rm.cpp 0000664 0001750 0001750 00000007325 12007254567 016557 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "plugin_types.h"
gchar *GetMIMEDescription()
{
gchar MimeTypes[4000];
GmPrefStore *store;
gboolean real_disabled = FALSE;
g_type_init();
store = gm_pref_store_new("gecko-mediaplayer");
if (store != NULL) {
real_disabled = gm_pref_store_get_boolean(store, DISABLE_REAL);
gm_pref_store_free(store);
}
if (real_disabled) {
return NULL;
} else {
g_strlcpy(MimeTypes,
"audio/x-pn-realaudio:ram,rm:RealAudio;"
"application/vnd.rn-realmedia:rm:RealMedia;"
"application/vnd.rn-realaudio:ra,ram:RealAudio;"
"video/vnd.rn-realvideo:rv:RealVideo;"
"audio/x-realaudio:ra:RealAudio;"
"audio/x-pn-realaudio-plugin:rpm:RealAudio;"
"application/smil:smil:SMIL;", sizeof(MimeTypes));
return g_strdup(MimeTypes);
}
}
NPError PluginGetValue(NPPVariable variable, void *value)
{
NPError err = NPERR_NO_ERROR;
// some sites use this description to figure out what formats can be played. So we have to make sure the
// description matches the features
if (variable == NPPVpluginNameString) {
*((const char **) value) = "RealPlayer 9";
}
if (variable == NPPVpluginDescriptionString) {
*((const char **) value) =
"Gecko Media Player "
VERSION
"
Video Player Plug-in for QuickTime, RealPlayer and Windows Media Player streams using MPlayer";
}
if (variable == NPPVpluginNeedsXEmbed) {
*((bool *) value) = TRUE;
}
if ((variable != NPPVpluginNameString)
&& (variable != NPPVpluginDescriptionString)
&& (variable != NPPVpluginNeedsXEmbed)) {
err = NPERR_INVALID_PARAM;
}
return err;
}
void pluginSpecific(CPlugin * instance)
{
instance->quicktime_emulation = FALSE;
}
gecko-mediaplayer-1.0.8/src/npn_gate.cpp 0000664 0001750 0001750 00000021122 12007254567 015121 0000000 0000000 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
////////////////////////////////////////////////////////////
//
// Implementation of Netscape entry points (NPN_*)
//
#include
//#include "npupp.h"
#include
#ifndef HIBYTE
#define HIBYTE(x) ((((uint32_t)(x)) & 0xff00) >> 8)
#endif
#ifndef LOBYTE
#define LOBYTE(W) ((W) & 0xFF)
#endif
extern NPNetscapeFuncs NPNFuncs;
void NPN_Version(int *plugin_major, int *plugin_minor, int *netscape_major, int *netscape_minor)
{
*plugin_major = NP_VERSION_MAJOR;
*plugin_minor = NP_VERSION_MINOR;
*netscape_major = HIBYTE(NPNFuncs.version);
*netscape_minor = LOBYTE(NPNFuncs.version);
}
NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void *notifyData)
{
int navMinorVers = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if (navMinorVers >= NPVERS_HAS_NOTIFICATION)
rv = NPNFuncs.geturlnotify(instance, url, target, notifyData);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
NPError NPN_GetURL(NPP instance, const char *url, const char *target)
{
NPError rv = NPNFuncs.geturl(instance, url, target);
return rv;
}
NPError NPN_PostURLNotify(NPP instance, const char *url, const char *window, uint32_t len,
const char *buf, NPBool file, void *notifyData)
{
int navMinorVers = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if (navMinorVers >= NPVERS_HAS_NOTIFICATION)
rv = NPNFuncs.posturlnotify(instance, url, window, len, buf, file, notifyData);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
NPError NPN_PostURL(NPP instance, const char *url, const char *window, uint32_t len,
const char *buf, NPBool file)
{
NPError rv = NPNFuncs.posturl(instance, url, window, len, buf, file);
return rv;
}
NPError NPN_RequestRead(NPStream * stream, NPByteRange * rangeList)
{
NPError rv = NPNFuncs.requestread(stream, rangeList);
return rv;
}
NPError NPN_NewStream(NPP instance, NPMIMEType type, const char *target, NPStream ** stream)
{
int navMinorVersion = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if (navMinorVersion >= NPVERS_HAS_STREAMOUTPUT)
rv = NPNFuncs.newstream(instance, type, target, stream);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
int32_t NPN_Write(NPP instance, NPStream * stream, int32_t len, void *buffer)
{
int navMinorVersion = NPNFuncs.version & 0xFF;
int32_t rv = 0;
if (navMinorVersion >= NPVERS_HAS_STREAMOUTPUT)
rv = NPNFuncs.write(instance, stream, len, buffer);
else
rv = -1;
return rv;
}
NPError NPN_DestroyStream(NPP instance, NPStream * stream, NPError reason)
{
int navMinorVersion = NPNFuncs.version & 0xFF;
NPError rv = NPERR_NO_ERROR;
if (navMinorVersion >= NPVERS_HAS_STREAMOUTPUT)
rv = NPNFuncs.destroystream(instance, stream, reason);
else
rv = NPERR_INCOMPATIBLE_VERSION_ERROR;
return rv;
}
void NPN_Status(NPP instance, const char *message)
{
NPNFuncs.status(instance, message);
}
const char *NPN_UserAgent(NPP instance)
{
const char *rv = NULL;
rv = NPNFuncs.uagent(instance);
return rv;
}
void *NPN_MemAlloc(uint32_t size)
{
void *rv = NULL;
rv = NPNFuncs.memalloc(size);
return rv;
}
void NPN_MemFree(void *ptr)
{
NPNFuncs.memfree(ptr);
}
uint32_t NPN_MemFlush(uint32_t size)
{
uint32_t rv = NPNFuncs.memflush(size);
return rv;
}
void NPN_ReloadPlugins(NPBool reloadPages)
{
NPNFuncs.reloadplugins(reloadPages);
}
/*
JRIEnv *NPN_GetJavaEnv(void)
{
JRIEnv *rv = NULL;
rv = NPNFuncs.getJavaEnv();
return rv;
}
jref NPN_GetJavaPeer(NPP instance)
{
jref rv;
rv = NPNFuncs.getJavaPeer(instance);
return rv;
}
*/
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
NPError rv = NPNFuncs.getvalue(instance, variable, value);
return rv;
}
NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
{
NPError rv = NPNFuncs.setvalue(instance, variable, value);
return rv;
}
void NPN_InvalidateRect(NPP instance, NPRect * invalidRect)
{
NPNFuncs.invalidaterect(instance, invalidRect);
}
void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
{
NPNFuncs.invalidateregion(instance, invalidRegion);
}
void NPN_ForceRedraw(NPP instance)
{
NPNFuncs.forceredraw(instance);
}
NPIdentifier NPN_GetStringIdentifier(const NPUTF8 * name)
{
if (!NPNFuncs.getstringidentifier)
return 0;
return NPNFuncs.getstringidentifier(name);
}
void NPN_GetStringIdentifiers(const NPUTF8 ** names, uint32_t nameCount, NPIdentifier * identifiers)
{
return NPNFuncs.getstringidentifiers(names, nameCount, identifiers);
}
NPIdentifier NPN_GetStringIdentifier(int32_t intid)
{
return NPNFuncs.getintidentifier(intid);
}
bool NPN_IdentifierIsString(NPIdentifier identifier)
{
return NPNFuncs.identifierisstring(identifier);
}
NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
{
return NPNFuncs.utf8fromidentifier(identifier);
}
int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
{
return NPNFuncs.intfromidentifier(identifier);
}
NPObject *NPN_CreateObject(NPP npp, NPClass * aClass)
{
return NPNFuncs.createobject(npp, aClass);
}
NPObject *NPN_RetainObject(NPObject * obj)
{
return NPNFuncs.retainobject(obj);
}
void NPN_ReleaseObject(NPObject * obj)
{
return NPNFuncs.releaseobject(obj);
}
bool NPN_Invoke(NPP npp, NPObject * obj, NPIdentifier methodName,
const NPVariant * args, uint32_t argCount, NPVariant * result)
{
return NPNFuncs.invoke(npp, obj, methodName, args, argCount, result);
}
bool NPN_InvokeDefault(NPP npp, NPObject * obj, const NPVariant * args,
uint32_t argCount, NPVariant * result)
{
return NPNFuncs.invokeDefault(npp, obj, args, argCount, result);
}
bool NPN_Evaluate(NPP npp, NPObject * obj, NPString * script, NPVariant * result)
{
return NPNFuncs.evaluate(npp, obj, script, result);
}
bool NPN_GetProperty(NPP npp, NPObject * obj, NPIdentifier propertyName, NPVariant * result)
{
return NPNFuncs.getproperty(npp, obj, propertyName, result);
}
bool NPN_SetProperty(NPP npp, NPObject * obj, NPIdentifier propertyName, const NPVariant * value)
{
return NPNFuncs.setproperty(npp, obj, propertyName, value);
}
bool NPN_RemoveProperty(NPP npp, NPObject * obj, NPIdentifier propertyName)
{
return NPNFuncs.removeproperty(npp, obj, propertyName);
}
bool NPN_HasProperty(NPP npp, NPObject * obj, NPIdentifier propertyName)
{
return NPNFuncs.hasproperty(npp, obj, propertyName);
}
bool NPN_HasMethod(NPP npp, NPObject * obj, NPIdentifier methodName)
{
return NPNFuncs.hasmethod(npp, obj, methodName);
}
void NPN_ReleaseVariantValue(NPVariant * variant)
{
NPNFuncs.releasevariantvalue(variant);
}
void NPN_SetException(NPObject * obj, const NPUTF8 * message)
{
NPNFuncs.setexception(obj, message);
}
gecko-mediaplayer-1.0.8/src/plugin_types.h 0000664 0001750 0001750 00000003753 12007254567 015527 0000000 0000000 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _PLUGIN_TYPES_H
#define _PLUGIN_TYPES_H
#include
#include "plugin.h"
#include "config.h"
gchar *GetMIMEDescription();
NPError PluginGetValue(NPPVariable variable, void *value);
#endif // _PLUGIN_TYPES_H
gecko-mediaplayer-1.0.8/src/np_entry.cpp 0000664 0001750 0001750 00000015720 12007254567 015173 0000000 0000000 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//////////////////////////////////////////////////////////////
//
// Main plugin entry point implementation
//
#include
#include
#include "npupp.h"
#ifdef HAVE_CONFIG_H
#include
#endif
#ifndef HIBYTE
#define HIBYTE(x) ((((uint32_t)(x)) & 0xff00) >> 8)
#endif
NPNetscapeFuncs NPNFuncs;
#ifdef XP_WIN
NPError OSCALL NP_GetEntryPoints(NPPluginFuncs * pFuncs)
{
if (pFuncs == NULL)
return NPERR_INVALID_FUNCTABLE_ERROR;
if (pFuncs->size < sizeof(NPPluginFuncs))
return NPERR_INVALID_FUNCTABLE_ERROR;
pFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
pFuncs->newp = NPP_New;
pFuncs->destroy = NPP_Destroy;
pFuncs->setwindow = NPP_SetWindow;
pFuncs->newstream = NPP_NewStream;
pFuncs->destroystream = NPP_DestroyStream;
pFuncs->asfile = NPP_StreamAsFile;
pFuncs->writeready = NPP_WriteReady;
pFuncs->write = NPP_Write;
pFuncs->print = NPP_Print;
pFuncs->event = NPP_HandleEvent;
pFuncs->urlnotify = NPP_URLNotify;
pFuncs->getvalue = NPP_GetValue;
pFuncs->setvalue = NPP_SetValue;
pFuncs->javaClass = NULL;
return NPERR_NO_ERROR;
}
#endif /* XP_WIN */
#ifdef NPAPI_USE_CONSTCHARS
const char *NPP_GetMIMEDescription();
const char *NP_GetMIMEDescription()
{
return NPP_GetMIMEDescription();
}
#else
char *NPP_GetMIMEDescription();
char *NP_GetMIMEDescription()
{
return NPP_GetMIMEDescription();
}
#endif
NPError NP_GetValue(void *future, NPPVariable variable, void *value)
{
return NPP_GetValue((NPP_t *) future, variable, value);
}
NPError OSCALL NP_Initialize(NPNetscapeFuncs * pFuncs
#ifdef XP_UNIX
, NPPluginFuncs * pluginFuncs
#endif
)
{
if (pFuncs == NULL)
return NPERR_INVALID_FUNCTABLE_ERROR;
if (HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
if (pFuncs->size < sizeof(NPNetscapeFuncs))
return NPERR_INVALID_FUNCTABLE_ERROR;
NPNFuncs.size = pFuncs->size;
NPNFuncs.version = pFuncs->version;
NPNFuncs.geturlnotify = pFuncs->geturlnotify;
NPNFuncs.geturl = pFuncs->geturl;
NPNFuncs.posturlnotify = pFuncs->posturlnotify;
NPNFuncs.posturl = pFuncs->posturl;
NPNFuncs.requestread = pFuncs->requestread;
NPNFuncs.newstream = pFuncs->newstream;
NPNFuncs.write = pFuncs->write;
NPNFuncs.destroystream = pFuncs->destroystream;
NPNFuncs.status = pFuncs->status;
NPNFuncs.uagent = pFuncs->uagent;
NPNFuncs.memalloc = pFuncs->memalloc;
NPNFuncs.memfree = pFuncs->memfree;
NPNFuncs.memflush = pFuncs->memflush;
NPNFuncs.reloadplugins = pFuncs->reloadplugins;
NPNFuncs.getJavaEnv = pFuncs->getJavaEnv;
NPNFuncs.getJavaPeer = pFuncs->getJavaPeer;
NPNFuncs.getvalue = pFuncs->getvalue;
NPNFuncs.setvalue = pFuncs->setvalue;
NPNFuncs.invalidaterect = pFuncs->invalidaterect;
NPNFuncs.invalidateregion = pFuncs->invalidateregion;
NPNFuncs.forceredraw = pFuncs->forceredraw;
NPNFuncs.getstringidentifier = pFuncs->getstringidentifier;
NPNFuncs.getstringidentifiers = pFuncs->getstringidentifiers;
NPNFuncs.getintidentifier = pFuncs->getintidentifier;
NPNFuncs.identifierisstring = pFuncs->identifierisstring;
NPNFuncs.utf8fromidentifier = pFuncs->utf8fromidentifier;
NPNFuncs.intfromidentifier = pFuncs->intfromidentifier;
NPNFuncs.createobject = pFuncs->createobject;
NPNFuncs.retainobject = pFuncs->retainobject;
NPNFuncs.releaseobject = pFuncs->releaseobject;
NPNFuncs.invoke = pFuncs->invoke;
NPNFuncs.invokeDefault = pFuncs->invokeDefault;
NPNFuncs.evaluate = pFuncs->evaluate;
NPNFuncs.getproperty = pFuncs->getproperty;
NPNFuncs.setproperty = pFuncs->setproperty;
NPNFuncs.removeproperty = pFuncs->removeproperty;
NPNFuncs.hasproperty = pFuncs->hasproperty;
NPNFuncs.hasmethod = pFuncs->hasmethod;
NPNFuncs.releasevariantvalue = pFuncs->releasevariantvalue;
NPNFuncs.setexception = pFuncs->setexception;
#ifdef XP_UNIX
/*
* Set up the plugin function table that Netscape will use to
* call us. Netscape needs to know about our version and size
* and have a UniversalProcPointer for every function we
* implement.
*/
pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
pluginFuncs->size = sizeof(NPPluginFuncs);
pluginFuncs->newp = NewNPP_NewProc(NPP_New);
pluginFuncs->destroy = NewNPP_DestroyProc(NPP_Destroy);
pluginFuncs->setwindow = NewNPP_SetWindowProc(NPP_SetWindow);
pluginFuncs->newstream = NewNPP_NewStreamProc(NPP_NewStream);
pluginFuncs->destroystream = NewNPP_DestroyStreamProc(NPP_DestroyStream);
pluginFuncs->asfile = NewNPP_StreamAsFileProc(NPP_StreamAsFile);
pluginFuncs->writeready = NewNPP_WriteReadyProc(NPP_WriteReady);
pluginFuncs->write = NewNPP_WriteProc(NPP_Write);
pluginFuncs->print = NewNPP_PrintProc(NPP_Print);
pluginFuncs->urlnotify = NewNPP_URLNotifyProc(NPP_URLNotify);
pluginFuncs->event = NULL;
pluginFuncs->getvalue = NewNPP_GetValueProc(NPP_GetValue);
#ifdef OJI
pluginFuncs->javaClass = NPP_GetJavaClass();
#endif
// NPP_Initialize();
#endif
return NPERR_NO_ERROR;
}
NPError OSCALL NP_Shutdown()
{
return NPERR_NO_ERROR;
}
gecko-mediaplayer-1.0.8/src/Makefile.in 0000664 0001750 0001750 00000072437 12114222474 014675 0000000 0000000 # Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
install_libexec_PROGRAMS = gecko-mediaplayer.so$(EXEEXT) \
gecko-mediaplayer-qt.so$(EXEEXT) \
gecko-mediaplayer-wmp.so$(EXEEXT) \
gecko-mediaplayer-rm.so$(EXEEXT) \
gecko-mediaplayer-dvx.so$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/depcomp $(top_srcdir)/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(install_libexecdir)"
PROGRAMS = $(install_libexec_PROGRAMS)
am__objects_1 = plugin.$(OBJEXT) memmem_compat.$(OBJEXT) \
plugin_list.$(OBJEXT) plugin_setup.$(OBJEXT) \
plugin_dbus.$(OBJEXT) np_entry.$(OBJEXT) npn_gate.$(OBJEXT) \
npp_gate.$(OBJEXT)
am_gecko_mediaplayer_dvx_so_OBJECTS = plugin_types_dvx.$(OBJEXT) \
$(am__objects_1)
gecko_mediaplayer_dvx_so_OBJECTS = \
$(am_gecko_mediaplayer_dvx_so_OBJECTS)
am__DEPENDENCIES_1 =
gecko_mediaplayer_dvx_so_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
gecko_mediaplayer_dvx_so_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(gecko_mediaplayer_dvx_so_LDFLAGS) $(LDFLAGS) -o $@
am_gecko_mediaplayer_qt_so_OBJECTS = plugin_types_qt.$(OBJEXT) \
$(am__objects_1)
gecko_mediaplayer_qt_so_OBJECTS = \
$(am_gecko_mediaplayer_qt_so_OBJECTS)
gecko_mediaplayer_qt_so_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
gecko_mediaplayer_qt_so_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(gecko_mediaplayer_qt_so_LDFLAGS) $(LDFLAGS) -o $@
am_gecko_mediaplayer_rm_so_OBJECTS = plugin_types_rm.$(OBJEXT) \
$(am__objects_1)
gecko_mediaplayer_rm_so_OBJECTS = \
$(am_gecko_mediaplayer_rm_so_OBJECTS)
gecko_mediaplayer_rm_so_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
gecko_mediaplayer_rm_so_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(gecko_mediaplayer_rm_so_LDFLAGS) $(LDFLAGS) -o $@
am_gecko_mediaplayer_wmp_so_OBJECTS = plugin_types_wmp.$(OBJEXT) \
$(am__objects_1)
gecko_mediaplayer_wmp_so_OBJECTS = \
$(am_gecko_mediaplayer_wmp_so_OBJECTS)
gecko_mediaplayer_wmp_so_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
gecko_mediaplayer_wmp_so_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(gecko_mediaplayer_wmp_so_LDFLAGS) $(LDFLAGS) -o $@
am_gecko_mediaplayer_so_OBJECTS = plugin_types_std.$(OBJEXT) \
$(am__objects_1)
gecko_mediaplayer_so_OBJECTS = $(am_gecko_mediaplayer_so_OBJECTS)
gecko_mediaplayer_so_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
gecko_mediaplayer_so_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(gecko_mediaplayer_so_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
am__v_CXX_0 = @echo " CXX " $@;
am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(gecko_mediaplayer_dvx_so_SOURCES) \
$(gecko_mediaplayer_qt_so_SOURCES) \
$(gecko_mediaplayer_rm_so_SOURCES) \
$(gecko_mediaplayer_wmp_so_SOURCES) \
$(gecko_mediaplayer_so_SOURCES)
DIST_SOURCES = $(gecko_mediaplayer_dvx_so_SOURCES) \
$(gecko_mediaplayer_qt_so_SOURCES) \
$(gecko_mediaplayer_rm_so_SOURCES) \
$(gecko_mediaplayer_wmp_so_SOURCES) \
$(gecko_mediaplayer_so_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CURL_CFLAGS = @CURL_CFLAGS@
CURL_DEFINES = @CURL_DEFINES@
CURL_LIBS = @CURL_LIBS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@
GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GECKO_CFLAGS = @GECKO_CFLAGS@
GECKO_LIBS = @GECKO_LIBS@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GMLIB_CFLAGS = @GMLIB_CFLAGS@
GMLIB_LIBS = @GMLIB_LIBS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GREP = @GREP@
GSETTINGS_RULES = @GSETTINGS_RULES@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
INTLLIBS = @INTLLIBS@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGFMT_OPTS = @MSGFMT_OPTS@
NSPR_CFLAGS = @NSPR_CFLAGS@
NSPR_LIBS = @NSPR_LIBS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
USE_GCONF = @USE_GCONF@
USE_GSETTINGS = @USE_GSETTINGS@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
plugindir = @plugindir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS =
DEFINES = -DMOZILLA_STRICT_API -DXP_UNIX
INCLUDES = \
-fPIC \
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
$(GECKO_CFLAGS) \
$(GLIB_CFLAGS) \
$(GMLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(DBUS_CFLAGS) \
$(DEFINES) \
$(CURL_DEFINES) \
$(CURL_CFLAGS)
AM_CFLAGS = \
-Wall \
-g
COMMONCODE = \
../config.h \
plugin.cpp \
memmem_compat.h \
memmem_compat.cpp \
plugin.h \
plugin_list.h \
plugin_list.cpp \
plugin_types.h \
plugin_setup.h \
plugin_setup.cpp \
plugin_dbus.h \
plugin_dbus.cpp \
np_entry.cpp \
npn_gate.cpp \
npp_gate.cpp \
npupp.h
install_libexecdir = $(plugindir)
gecko_mediaplayer_so_SOURCES = \
plugin_types_std.cpp \
$(COMMONCODE)
gecko_mediaplayer_so_CFLAGS = -fPIC
gecko_mediaplayer_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
gecko_mediaplayer_qt_so_SOURCES = \
plugin_types_qt.cpp \
$(COMMONCODE)
gecko_mediaplayer_qt_so_CFLAGS = -fPIC
gecko_mediaplayer_qt_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_qt_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
gecko_mediaplayer_wmp_so_SOURCES = \
plugin_types_wmp.cpp \
$(COMMONCODE)
gecko_mediaplayer_wmp_so_CFLAGS = -fPIC
gecko_mediaplayer_wmp_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_wmp_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
gecko_mediaplayer_dvx_so_SOURCES = \
plugin_types_dvx.cpp \
$(COMMONCODE)
gecko_mediaplayer_dvx_so_CFLAGS = -fPIC
gecko_mediaplayer_dvx_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_dvx_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
gecko_mediaplayer_rm_so_SOURCES = \
plugin_types_rm.cpp \
$(COMMONCODE)
gecko_mediaplayer_rm_so_CFLAGS = -fPIC
gecko_mediaplayer_rm_so_LDFLAGS = -shared -fPIC
gecko_mediaplayer_rm_so_LDADD = -ldl $(GLIB_LIBS) $(GMLIB_LIBS) $(DBUS_LIBS) $(CURL_LIBS) $(GIO_LIBS)
all: all-recursive
.SUFFIXES:
.SUFFIXES: .cpp .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-install_libexecPROGRAMS: $(install_libexec_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(install_libexec_PROGRAMS)'; test -n "$(install_libexecdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(install_libexecdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(install_libexecdir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p; \
then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(install_libexecdir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(install_libexecdir)$$dir" || exit $$?; \
} \
; done
uninstall-install_libexecPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(install_libexec_PROGRAMS)'; test -n "$(install_libexecdir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(install_libexecdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(install_libexecdir)" && rm -f $$files
clean-install_libexecPROGRAMS:
-test -z "$(install_libexec_PROGRAMS)" || rm -f $(install_libexec_PROGRAMS)
gecko-mediaplayer-dvx.so$(EXEEXT): $(gecko_mediaplayer_dvx_so_OBJECTS) $(gecko_mediaplayer_dvx_so_DEPENDENCIES) $(EXTRA_gecko_mediaplayer_dvx_so_DEPENDENCIES)
@rm -f gecko-mediaplayer-dvx.so$(EXEEXT)
$(AM_V_CXXLD)$(gecko_mediaplayer_dvx_so_LINK) $(gecko_mediaplayer_dvx_so_OBJECTS) $(gecko_mediaplayer_dvx_so_LDADD) $(LIBS)
gecko-mediaplayer-qt.so$(EXEEXT): $(gecko_mediaplayer_qt_so_OBJECTS) $(gecko_mediaplayer_qt_so_DEPENDENCIES) $(EXTRA_gecko_mediaplayer_qt_so_DEPENDENCIES)
@rm -f gecko-mediaplayer-qt.so$(EXEEXT)
$(AM_V_CXXLD)$(gecko_mediaplayer_qt_so_LINK) $(gecko_mediaplayer_qt_so_OBJECTS) $(gecko_mediaplayer_qt_so_LDADD) $(LIBS)
gecko-mediaplayer-rm.so$(EXEEXT): $(gecko_mediaplayer_rm_so_OBJECTS) $(gecko_mediaplayer_rm_so_DEPENDENCIES) $(EXTRA_gecko_mediaplayer_rm_so_DEPENDENCIES)
@rm -f gecko-mediaplayer-rm.so$(EXEEXT)
$(AM_V_CXXLD)$(gecko_mediaplayer_rm_so_LINK) $(gecko_mediaplayer_rm_so_OBJECTS) $(gecko_mediaplayer_rm_so_LDADD) $(LIBS)
gecko-mediaplayer-wmp.so$(EXEEXT): $(gecko_mediaplayer_wmp_so_OBJECTS) $(gecko_mediaplayer_wmp_so_DEPENDENCIES) $(EXTRA_gecko_mediaplayer_wmp_so_DEPENDENCIES)
@rm -f gecko-mediaplayer-wmp.so$(EXEEXT)
$(AM_V_CXXLD)$(gecko_mediaplayer_wmp_so_LINK) $(gecko_mediaplayer_wmp_so_OBJECTS) $(gecko_mediaplayer_wmp_so_LDADD) $(LIBS)
gecko-mediaplayer.so$(EXEEXT): $(gecko_mediaplayer_so_OBJECTS) $(gecko_mediaplayer_so_DEPENDENCIES) $(EXTRA_gecko_mediaplayer_so_DEPENDENCIES)
@rm -f gecko-mediaplayer.so$(EXEEXT)
$(AM_V_CXXLD)$(gecko_mediaplayer_so_LINK) $(gecko_mediaplayer_so_OBJECTS) $(gecko_mediaplayer_so_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memmem_compat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/np_entry.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/npn_gate.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/npp_gate.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_dbus.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_list.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_setup.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_types_dvx.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_types_qt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_types_rm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_types_std.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_types_wmp.Po@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
cscopelist-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile $(PROGRAMS)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(install_libexecdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-install_libexecPROGRAMS mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am: install-install_libexecPROGRAMS
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-install_libexecPROGRAMS
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
cscopelist-recursive ctags-recursive install-am install-strip \
tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic \
clean-install_libexecPROGRAMS cscopelist cscopelist-recursive \
ctags ctags-recursive distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-install_libexecPROGRAMS install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
ps ps-am tags tags-recursive uninstall uninstall-am \
uninstall-install_libexecPROGRAMS
indent:
indent -kr -l100 -i4 -nut *.cpp
indent -kr -l100 -i4 -nut *.h
rm *~
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
gecko-mediaplayer-1.0.8/gecko-mediaplayer.spec 0000664 0001750 0001750 00000003240 12114222500 016247 0000000 0000000 %define ver 1.0.8
%define use_gconf
Name: gecko-mediaplayer
Summary: Multimedia browser plugin for Gecko based browsers
Version: %{ver}
Release: 1%{?dist}
License: GPLv2+
Group: Internet/Multimedia
Packager: Kevin DeKorte
Source0: http://dekorte.homeip.net/download/gecko-mediaplayer/gecko-mediaplayer-%{ver}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: gnome-mplayer
%if 0%{?fedora} > 8
BuildRequires: gcc-c++, pkgconfig, gettext, xulrunner-devel, dbus-devel, dbus-glib-devel, glib2-devel, GConf2-devel, libX11-devel libcurl-devel
%else
BuildRequires: gcc-c++, pkgconfig, gettext, firefox-devel, dbus-devel, dbus-glib-devel, glib2-devel, GConf2-devel, libX11-devel
%endif
%description
Gecko Media Player is a browser plugin that uses GNOME MPlayer to play media in a browser. It should work with all browsers on Unix-ish systems(Linux, BSD, Solaris) and use the NS4 API (Mozilla, Firefox, Opera, etc.). Gecko Media Player is in heavy development, but I wanted to get some code drops out there so that people can start using and testing it.
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
rm -rf %buildroot
make install DESTDIR=%buildroot
%clean
rm -rf $buildroot
%post
update-desktop-database %{_datadir}/applications
%if %{use_gconf}
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
if [ -e %{_sysconfdir}/gconf/schemas/gecko-mediaplayer.schemas ]; then
gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/gecko-mediaplayer.schemas > /dev/null
fi
%endif
%files
%defattr(-,root,root,-)
%{_docdir}/%{name}
%{_libdir}/mozilla
%{_datadir}/locale
%if %{use_gconf}
%config %{_sysconfdir}
%endif
gecko-mediaplayer-1.0.8/configure.in 0000664 0001750 0001750 00000015230 12114222464 014335 0000000 0000000 dnl Process this file with autoconf to produce a configure script.
dnl Created by Anjuta application wizard.
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(gecko-mediaplayer, 1.0.8)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE([enable])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_PROG_CPP
AC_PROG_CXX
AM_PROG_CC_C_O
AC_PROG_RANLIB
dnl Set gettext package name
GETTEXT_PACKAGE=gecko-mediaplayer
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
dnl Add the languages which your application supports here.
ALL_LINGUAS="cs de es fr ja it nl pl pt pt_BR tr"
AM_GLIB_GNU_GETTEXT
PKG_CHECK_MODULES(GLIB, [glib-2.0])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(GMLIB, [gmlib >= 1.0.7])
AC_SUBST(GMLIB_CFLAGS)
AC_SUBST(GMLIB_LIBS)
AC_ARG_WITH([xulrunner-sdk],
[AS_HELP_STRING([--with-xulrunner-sdk=path_to_sdk],
[Path to xulrunner SDK for build --with-xulrunner-sdk=/path/to/sdk])],
[
XULRUNNER_SDK_PREFIX=$with_xulrunner_sdk
GECKO_CFLAGS="-I$XULRUNNER_SDK_PREFIX/include -I$XULRUNNER_SDK_PREFIX/include/plugin -I$XULRUNNER_SDK_PREFIX/include/nspr -I$XULRUNNER_SDK_PREFIX/include/xpcom -I$XULRUNNER_SDK_PREFIX/include/string -I$XULRUNNER_SDK_PREFIX/include/java"
GECKO_LIBS="-L$XULRUNNER_SDK_PREFIX/lib -lxpcomglue_s -lxul -lxpcom -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
],
[])
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [libxul >= 2],[GECKO_CFLAGS="$GECKO_CFLAGS -DMOZ_NO_MOZALLOC"
AC_MSG_NOTICE([Using libxul >= 2.0 ])
],[AC_MSG_NOTICE([libxul >= 2 not found, trying another])])
fi
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [libxul >= 1.9.2],[ AC_MSG_NOTICE([Using libxul >= 1.9.2])
],[AC_MSG_NOTICE([libxul >= 1.9.2 not found, trying another])])
fi
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [libxul < 1.9.2],[ AC_MSG_NOTICE([Using libxul < 1.9.2])
],[AC_MSG_WARN([libxul < 1.9.2 not found, trying another])])
fi
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [libxul-unstable],[ AC_MSG_NOTICE([Using libxul-unstable])
],[AC_MSG_WARN([libxul-unstable not found, trying another])])
fi
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [mozilla-plugin mozilla-xpcom],[ AC_MSG_NOTICE([Using mozilla])
],[AC_MSG_WARN([mozilla-plugin not found, trying another])])
fi
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [firefox-plugin firefox-xpcom],[ AC_MSG_NOTICE([Using firefox])
],[AC_MSG_WARN([firefox-plugin not found, trying another])])
fi
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [seamonkey-plugin seamonkey-xpcom],[ AC_MSG_NOTICE([Using seamonkey])
],[AC_MSG_WARN([seamonkey-plugin not found, trying another])])
fi
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [xulrunner-plugin xulrunner-xpcom],[ AC_MSG_NOTICE([Using xulrunner])
],[AC_MSG_WARN([xulrunner-plugin not found, trying another])])
fi
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [iceape-plugin iceape-xpcom],[ AC_MSG_NOTICE([Using iceape])
],[AC_MSG_WARN([iceape-plugin not found, trying another])])
fi
if test "$GECKO_CFLAGS" = ""; then
PKG_CHECK_MODULES(GECKO, [npapi-sdk],[ AC_MSG_NOTICE([Using npapi-sdk])
],[AC_MSG_ERROR([npapi-sdk not found, all out of tries])])
require_nspr="yes"
fi
AC_MSG_CHECKING([for const return value of NPP_GetMIMEDescription])
oCFLAGS=$CFLAGS
CFLAGS="$GECKO_CFLAGS"
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#ifndef XP_UNIX
#define XP_UNIX 1
#endif
#include
#if NP_VERSION_MAJOR == 0 && NP_VERSION_MINOR < 27
#error
#else
const char*NPP_GetMIMEDescription(void) {
return "test";
}
#endif
],[
const char *f=NPP_GetMIMEDescription();
])],[
AC_MSG_RESULT([yes])
AC_DEFINE([NPAPI_USE_CONSTCHARS],[1],[Define if NPAPI declares NPP_GetMIMEDescription as a const char*])
],[
AC_MSG_RESULT([no])
])
AC_LANG_POP([C])
CFLAGS=$oCFLAGS
AC_MSG_CHECKING([for usage of UTF8Characters])
oCFLAGS=$CFLAGS
CFLAGS="$GECKO_CFLAGS"
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#ifndef XP_UNIX
#define XP_UNIX 1
#endif
#include
#include
],[
NPString s;
s.UTF8Characters = "Testing";
])],[
AC_MSG_RESULT([yes])
AC_DEFINE([NPAPI_USE_UPPERCASE_UTF8],[1],[Define if NPAPI declares NPString with an uppercase UTF8])
],[
AC_MSG_RESULT([no])
])
AC_LANG_POP([C])
CFLAGS=$oCFLAGS
dnl Locate where the plugins should go
PKG_CHECK_MODULES(NSPR, [nspr],[
libdir=`$PKG_CONFIG --variable=libdir nspr`
AC_SUBST(libdir)
if test "$require_nspr" = "yes"; then
AC_DEFINE([HAVE_NSPR],[1],[Define to 1 if using nspr])
GECKO_CFLAGS="$GECKO_CFLAGS $NSPR_CFLAGS"
fi],[if test "$require_nspr" = "yes"; then
AC_MSG_ERROR([nspr not found, required by detected gecko])
else
AC_MSG_WARN([nspr not found, may not be needed])
fi])
AC_SUBST(GECKO_CFLAGS)
AC_SUBST(GECKO_LIBS)
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.95 dbus-glib-1 >= 0.70])
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
AC_ARG_WITH([plugin_dir],
[AS_HELP_STRING([--with-plugin-dir=dir],
[Directory where plugins are stored])],
[plugindir=$withval],
[plugindir='$(libdir)/mozilla/plugins'])
AC_SUBST(plugindir)
AC_ARG_ENABLE(caching,
AC_HELP_STRING([--disable-caching],[Disable caching of remote media to local storage]),
[usecache=$enableval],[usecache=yes])
if test $usecache != yes; then
GECKO_CFLAGS="$GECKO_CFLAGS -DDISABLE_CACHE"
fi
AC_ARG_WITH([libcurl],
[AS_HELP_STRING([--with-libcurl],
[Add support for libcurl])],
[],
[with_libcurl=check])
AS_IF([test "x$with_libcurl" != xno],
[PKG_CHECK_MODULES(CURL,[libcurl],[CURL_DEFINES="-DHAVE_CURL" AC_DEFINE([CURL_ENABLED],[1],[Define to 1 if you have curl support])],AC_MSG_NOTICE([Compiling without curl support. May disable apple.com sites]))
AC_SUBST(CURL_DEFINES)
AC_SUBST(CURL_CFLAGS)
AC_SUBST(CURL_LIBS)
])
BACKEND=`pkg-config --variable=preference_backend gmlib`
if test ${BACKEND} = "gsettings"; then
AC_MSG_NOTICE([gmlib is using ${BACKEND} for preference storage])
dnl GLIB_GSETTINGS
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL],[false])
USE_GSETTINGS=1
AC_SUBST(USE_GSETTINGS)
elif test ${BACKEND} = "gconf"; then
AC_MSG_NOTICE([gmlib is using ${BACKEND} for preference storage])
GSETTINGS_RULES=""
AC_SUBST(GSETTINGS_RULES)
AM_GCONF_SOURCE_2
USE_GCONF=1
AC_SUBST(USE_GCONF)
elif test ${BACKEND} = "keystore"; then
GSETTINGS_RULES=""
AC_SUBST(GSETTINGS_RULES)
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL],[false])
fi
AC_OUTPUT([
Makefile
gecko-mediaplayer.spec
src/Makefile
po/Makefile.in
])
gecko-mediaplayer-1.0.8/INSTALL 0000664 0001750 0001750 00000036605 12110165613 013064 0000000 0000000 Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
gecko-mediaplayer-1.0.8/config.guess 0000755 0001750 0001750 00000130611 11212767243 014352 0000000 0000000 #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2008-11-15'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner .
# Please send patches to . Submit a context
# diff and a properly formatted ChangeLog entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit build system type.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm:riscos:*:*|arm:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if echo '\n#ifdef __amd64\nIS_64BIT_ARCH\n#endif' | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c &&
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`$dummy $dummyarg` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd | genuineintel)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips
#undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips64
#undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mips64el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips64
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
# Set LC_ALL=C to ensure ld outputs messages in English.
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
s/ .*//
p'`
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
LIBC=gnu
# else
LIBC=gnulibc1
# endif
# else
LIBC=gnulibc1
# endif
#else
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
#endif
#endif
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^LIBC/{
s: ::g
p
}'`"
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
}
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <
# include
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
c34*)
echo c34-convex-bsd
exit ;;
c38*)
echo c38-convex-bsd
exit ;;
c4*)
echo c4-convex-bsd
exit ;;
esac
fi
cat >&2 < in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
gecko-mediaplayer-1.0.8/README 0000664 0001750 0001750 00000000000 10762015264 012676 0000000 0000000 gecko-mediaplayer-1.0.8/config.sub 0000755 0001750 0001750 00000101756 11212767243 014025 0000000 0000000 #! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2008-09-08'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to . Submit a context
# diff and a properly formatted ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit ;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| mt \
| msp430 \
| nios | nios2 \
| ns16k | ns32k \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| score \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rdos)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tile*)
basic_machine=tile-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
gecko-mediaplayer-1.0.8/COPYING 0000664 0001750 0001750 00000043122 10762015264 013065 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
gecko-mediaplayer-1.0.8/mkinstalldirs 0000775 0001750 0001750 00000006722 12110165613 014636 0000000 0000000 #! /bin/sh
# mkinstalldirs --- make directory hierarchy
scriptversion=2009-04-28.21; # UTC
# Original author: Noah Friedman
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
nl='
'
IFS=" "" $nl"
errstatus=0
dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to ."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit $?
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit $?
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the 'mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because '.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
for file
do
case $file in
/*) pathcomp=/ ;;
*) pathcomp= ;;
esac
oIFS=$IFS
IFS=/
set fnord $file
shift
IFS=$oIFS
for d
do
test "x$d" = x && continue
pathcomp=$pathcomp$d
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp=$pathcomp/
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
gecko-mediaplayer-1.0.8/Makefile.am 0000664 0001750 0001750 00000001603 11667177047 014101 0000000 0000000 ## Process this file with automake to produce Makefile.in
## Created by Anjuta
SUBDIRS = src po
gecko_mediaplayerdocdir = ${docdir}
gecko_mediaplayerdoc_DATA = \
README\
COPYING\
AUTHORS\
ChangeLog\
INSTALL\
NEWS\
DOCS/tech/javascript.txt
if GCONF_SCHEMAS_INSTALL
schemadir = @GCONF_SCHEMA_FILE_DIR@
schema_DATA = gecko-mediaplayer.schemas
endif
EXTRA_DIST = $(gecko_mediaplayerdoc_DATA) $(schema_DATA) gecko-mediaplayer.spec.in gecko-mediaplayer.schemas
# Copy all the spec files. Of cource, only one is actually used.
dist-hook:
for specfile in *.spec; do \
if test -f $$specfile; then \
cp -p $$specfile $(distdir); \
fi \
done
install-schemas: $(schema_DATA)
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(schema_DATA) 2>&1 > /dev/null
if GCONF_SCHEMAS_INSTALL
install-data-hook: install-schemas
else
install-data-hook:
endif
gecko-mediaplayer-1.0.8/config.h 0000664 0001750 0001750 00000005076 12114222500 013440 0000000 0000000 /* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have curl support */
#define CURL_ENABLED 1
/* always defined to indicate that i18n is enabled */
#define ENABLE_NLS 1
/* GETTEXT package name */
#define GETTEXT_PACKAGE "gecko-mediaplayer"
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
/* Define to 1 if you have the `dcgettext' function. */
#define HAVE_DCGETTEXT 1
/* Define if the GNU gettext() function is already present or preinstalled. */
#define HAVE_GETTEXT 1
/* Define to 1 if you have the header file. */
#define HAVE_INTTYPES_H 1
/* Define if your file defines LC_MESSAGES. */
#define HAVE_LC_MESSAGES 1
/* Define to 1 if you have the header file. */
#define HAVE_LOCALE_H 1
/* Define to 1 if you have the header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if using nspr */
/* #undef HAVE_NSPR */
/* Define to 1 if you have the header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Define if NPAPI declares NPP_GetMIMEDescription as a const char* */
#define NPAPI_USE_CONSTCHARS 1
/* Define if NPAPI declares NPString with an uppercase UTF8 */
#define NPAPI_USE_UPPERCASE_UTF8 1
/* Name of package */
#define PACKAGE "gecko-mediaplayer"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "1.0.8"
gecko-mediaplayer-1.0.8/NEWS 0000664 0001750 0001750 00000000000 10762015264 012515 0000000 0000000 gecko-mediaplayer-1.0.8/missing 0000775 0001750 0001750 00000023703 12110165613 013425 0000000 0000000 #! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2012-01-06.18; # UTC
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, 'missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file 'aclocal.m4'
autoconf touch file 'configure'
autoheader touch file 'config.h.in'
autom4te touch the output file, or create a stub one
automake touch all 'Makefile.in' files
bison create 'y.tab.[ch]', if possible, from existing .[ch]
flex create 'lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create 'lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create 'y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to ."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running '$TOOL --version' or '$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified 'acinclude.m4' or '${configure_ac}'. You might want
to install the Automake and Perl packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified '${configure_ac}'. You might want to install the
Autoconf and GNU m4 packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified 'acconfig.h' or '${configure_ac}'. You might want
to install the Autoconf and GNU m4 packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
You might want to install the Automake and Perl packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: '$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get '$1' as part of Autoconf from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: '$1' $msg. You should only need it if
you modified a '.y' file. You may need the Bison package
in order for those modifications to take effect. You can get
Bison from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified a '.l' file. You may need the Flex package
in order for those modifications to take effect. You can get
Flex from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
Help2man package in order for those modifications to take
effect. You can get Help2man from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified a '.texi' or '.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy 'make' (AIX,
DU, IRIX). You might want to install the Texinfo package or
the GNU make package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
*)
echo 1>&2 "\
WARNING: '$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the 'README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing '$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
gecko-mediaplayer-1.0.8/gecko-mediaplayer.schemas 0000664 0001750 0001750 00000005017 11535256437 016772 0000000 0000000
/schemas/apps/gecko-mediaplayer/preferences/disable-qt
/apps/gecko-mediaplayer/preferences/disable-qt
gecko-mediaplayer
bool
false
Disable QuickTime Support
Disable QuickTime Support in gecko-mediaplayer
/schemas/apps/gecko-mediaplayer/preferences/disable-real
/apps/gecko-mediaplayer/preferences/disable-real
gecko-mediaplayer
bool
false
Disable RealMedia Support
Disable RealMedia Support in gecko-mediaplayer
/schemas/apps/gecko-mediaplayer/preferences/disable-wmp
/apps/gecko-mediaplayer/preferences/disable-wmp
gecko-mediaplayer
bool
false
Disable Windows Media Support
Disable Windows Media Support in gecko-mediaplayer
/schemas/apps/gecko-mediaplayer/preferences/disable-dvx
/apps/gecko-mediaplayer/preferences/disable-dvx
gecko-mediaplayer
bool
false
Disable DiVX Support
Disable DiVX Support in gecko-mediaplayer
/schemas/apps/gecko-mediaplayer/preferences/debug-level
/apps/gecko-mediaplayer/preferences/debug-level
gecko-mediaplayer
int
0
Set debug level
Set debug level higher numbers give more verbose messages
/schemas/apps/gecko-mediaplayer/preferences/player-backend
/apps/gecko-mediaplayer/preferences/player-backend
gecko-mediaplayer
string
Backend to use
Backend to use
gecko-mediaplayer-1.0.8/config.h.in 0000664 0001750 0001750 00000004563 12114222500 014045 0000000 0000000 /* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have curl support */
#undef CURL_ENABLED
/* always defined to indicate that i18n is enabled */
#undef ENABLE_NLS
/* GETTEXT package name */
#undef GETTEXT_PACKAGE
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
#undef HAVE_BIND_TEXTDOMAIN_CODESET
/* Define to 1 if you have the `dcgettext' function. */
#undef HAVE_DCGETTEXT
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
/* Define to 1 if you have the header file. */
#undef HAVE_INTTYPES_H
/* Define if your file defines LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to 1 if you have the header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if you have the header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if using nspr */
#undef HAVE_NSPR
/* Define to 1 if you have the header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Define if NPAPI declares NPP_GetMIMEDescription as a const char* */
#undef NPAPI_USE_CONSTCHARS
/* Define if NPAPI declares NPString with an uppercase UTF8 */
#undef NPAPI_USE_UPPERCASE_UTF8
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
gecko-mediaplayer-1.0.8/compile 0000775 0001750 0001750 00000016103 12110165613 013400 0000000 0000000 #! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-03-05.13; # UTC
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
# Written by Tom Tromey .
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
gecko-mediaplayer-1.0.8/ChangeLog 0000664 0001750 0001750 00000041625 12114222531 013600 0000000 0000000 Development
1.0.8
Updated Spanish translation
Updated Japanese translation
1.0.8b
Allow compiling on older libxuls where certain constants are not defined
1.0.7
1.0.7b
1.0.7a1
Version bump to 1.0.7a1
Very Large Change
rework the processing of playlists so that items are downloaded
one at a time and only as needed
Convert NPRES and NPERR codes to text in messages
ASX and M3U files should be properly parsed and not streamed in all cases
Add ASX to the list of types that should be streamed, and fix the code so that it is case insensitive
Switch plugin to streaming mode with #EXTM3U is found in the file
Clean up some depreciated symbol warnings
Convert plugin_list to use gm_log
Convert the majority of the code to use gm_log instead of printf
1.0.6
Updated Portuguese translation
Updated Japanese translation
1.0.6b1
Fix a problem in the style parser, was looking at a null pointer
Added WMP plugin properties enabled and enableContextMenu
Suppress list display
Add rtp to the list of streaming uris
Set PACKAGE_LOCALE_DIR based on --localedir from configure
Change HAVE_NEW_XULRUNNER to NPAPI_USE_UPPERCASE_UTF8
Drop --enable_new_libxul configure flag as it is autodetected now
Fix spelling mistake, but then comment out as not needed for normal usage Issue #163
1.0.5
Disable playing of partially cached apple.com files, mplayer seems to crash on these files
Use the right schema file, can't believe this one has slipped by so long.
Use better const check from Issue #161, patch from i.stakenvicius
1.0.5b2
Simpifying const check until something better comes along Issue #162
Fix Issue #161, improvements over last patch because NPAPI not properly bumped
Fix support for older xulrunners, Issue #160, issue caused by patch from
Issue #158
Support nsapi-sdk, based on patch from Issue #159
Fix up some const casting so that compilers do not complain Issue #158
Updated Japanese translation
Updated Italian translation
1.0.5b1
When uri is a file:// uri, just play it directly
Switch from AM_MAINTAINER_MODE to AM_MAINTAINER_MODE([enable]) in configure.in
Fix Issue #150, return value for function that says it will
Updated Dutch translation
Conversion to using libgmtk as separate library
Improvements to the apple.com/trailers fix, caching now works properly
Fix regression at apple.com/trailers, side effect of fully caching the file for now
1.0.4
Fix problem where file is downloaded before gnome-mplayer is started (locally cached)
Added Portuguese translation
Remove some whitespace
Updated French translation
Updated Polish translation
Updated Turkish translation
1.0.4b2
If http is found in the URL it may not be a stream (this might break some sites)
Get status messages looking better, requires gnome-mplayer from SVN on same date
Disable Windows OnDSPlayStateChangeEvt callback
Emulate WMP status
Emulate WMP versionInfo
Add in some more WMP javascript emulation
Align PlayStateChanges similar to WMP
Rework how media events are handled
Fix problems with SetVolume
Remove a couple of state change callbacks to stop fork bomb
Call javascript function OnDSPlayStateChange if it is exists
Add .media.getItemInfo title,url, bitrate to WMP Javascript emulation
Add .URL to WMP Javascript emulation
Updated Polish translation
Add .media.duration to WMP Javascript emulation
Add .settings.volume to WMP Javascript emulation
1.0.4b1
When getting a file from Apple, only play the first media link
Add udp as supported streaming format
Fix up some issues with apple trailers
1.0.3
Allow files > 2GB to be loaded in NP_FULL mode
Always include gecko-mediaplayer.schema in tar file
Make configure option --with-gconf=yes override use of gsettings
1.0.3beta
Cleanup some compile warnings
Try out silent make files
Mark asf files as streaming
Remove code to set the firefox preference
Version bump to 1.0.3beta
Apply changes to fix compiling on Ubuntu
Apply config changes to gconf schema
Apply changes to make gecko-mediaplayer with with gnome-mplayer 1.0.3beta and higher
Apply patch from issue #126
Updated Turkish translation
Work around xulrunner api change Issue #124
Fix a couple of NULL pointer errors Issue #123
Fixes to using libcurl
Only do list_dump when we process the list
Use libcurl to fetch content when running in QuickTime emulation
Fix spot where QuickTime was not set to 7.6.9
Get width and height from the style attribute if present
Bump QuickTime emulated version to 7.6.9
1.0.0
Fix problem with javascript seek function where value was coming in as an int where unexpected
Change libxul 2.0 check from 2.0b5 to just 2.0
Fix incorrect variable
Apply patch from Onur Kucuk to allow gecko-mediaplayer to compile against
xulrunner 2.0beta5 and higher
Fully qualify streaming URLs loaded from the embed tag
Obtain the plugin caller page and use that to resolve streaming urls
Fix problem where first item on list is not playable
Support qtsrcdontusebrowser option
Updated Spanish translation
Add WEBM types to plugin
Handle nocache=1 better
Mark asx files with ENTRY in them as non-playable
Allow separate cache sizes for audio or video data, depends on mimetype identification
Protect against NULL console
Added German translation
Move "stream" test to streaming function, change from int to boolean
If url has "stream" in it, mark the url as streaming
Give each item in the RAM playlist a unique id
0.9.9.2
Detect and use NS_GetServiceManager dynamically
Keep requested flag consistent
Work better with .m3u playlists
Reorder configure.in checks
Fix Apple HD Gallery site (target = QuickTime issue)
Add --enable-new-libxul when using --with-xulrunner-sdk
User proper NPERR and NPRES codes in the URLNotify and DestroyStream
0.9.9
Minor changes to the preference setting code
Start preparing for 0.9.9 release
Revert website change from movies to www at apple.com
Fix javascript calls PlayAt, Get/SetAutoPlay
Bump QuickTime emulation to 7.6.4
Fix new apple HD trailers, where trailers is downloaded from the menu
Use correct controlid with launching some apple.com HD videos
For apple.com videos change movies.apple.com to www.apple.com
Fix compile with libxul 1.9.2 and higher
Fix crash on http://itunes.apple.com/us/album/endangered-species-live-at-abbey/id309810246
Support the qtnext parameter
Rework code to work better with xulrunner 1.9.2
Use preferred player in all launch cases
Add support for VLC plugin emulation
Add new mimetype video/x-ms-asx
Allow for configurable backend (fosfor or gnome-mplayer or something else)
Make dom event javascript a little more unique
React to Network Errors in DestroyStream differently
Added /DEBUG path for debugging purposes
Added ListDump dbus method
konqueror patch from Christian.Morales.Vega
plugin-dir patch from Christian.Morales.Vega
0.9.8
When cancelling a stream (USER_BREAK) and the cancelled one is streaming
don't automatically load the next item on the playlist
When stream->lastmodified == 0 mark stream as streaming
fixes http://www.radioswissclassic.ch/en
Various fixes from the mailing list
Version bump
Add in new type of qt parser, make videos at PBS.org work
Move on to the next item in the playlist, when the an open item gives an error
Fix the autostart property when then plugin window is hidden
Only emulate QuickTime with the qt plugin
Change the user agent to "QuickTime/7.6.2" while the plugin is loaded, makes Apple.com/trailers work again
0.9.7
Clean up code with 'make indent'
Added a RAM parser
Added Czech translation by Petr Pisar
Add Dutch translation
Add in check for GIO, enables functionality in libgmlib
Remove need for LIBTOOL, program should compile cleaner now
Patch to correct --as-needed linker flag
0.9.6
Fix constant issue with old xulrunner kits
Update GUI while cache is loading
Make Copy Location get the entire url
Add support for Apple's 'postdomevents' option
Apply browser id patch to work around site specifically looking for mplayerplug-in
Infrastructure to support windowless mode, but it doesn't work
Convert internal preference store to gm_pref_store from libgmlib
Reuse gm_tempname from libgmlib saving duplicate code
Merge in libgmlib, it is pulled from the gnome-mplayer svn
0.9.5
Fix problem with memmem on OpenBSD, memmem_compat is now used by all
Added Japanese Translation by Munehiro Yamamoto
Fixed issue with pt_BR.po file
0.9.4
Add support for OpenBSD which does not have memmem
Add Italian translation by Francesco Groccia
Make gecko-mediaplayer work in Konqueror 4
Keep updating progress text until file is completely downloaded
Try to get bitrate from media at 1-5% markers
Remove gconftool --shutdown from makefile
Cleanup configure.in and Makefile.am files
Remove unnecessary files from build tree
Switch from XPCom to NPRuntime support
Fix a problem with the dbus path when the side provides and invalid path
Fix some compliation issues with xulrunner-sdk 1.9.1
Workaround file rename in xulrunner sdk
0.9.3
Make http://everadio.gamingradio.net work
Fix compilation dependancy
Now translations work
Enable translations hopefully
Replace call to getenv with g_getenv
Flip to streaming mode when we get a sequence starting with "Content-length"
Fix video/mpeg declaration
More mimetype cleanup
Add audio/ogg and video/ogg mimetypes
Add mimetype application/ogg
Allow compile against xulrunner-sdk
Added a couple of additional mimetypes
0.9.2
Convert to XDG cache location
Try using gnome-mplayer if not found use gnome-mplayer-minimal
Version bump
Fix up a couple of minor compile warnings
Move temporary files from TMPDIR to .gnome-mplayer cache directory
0.9.0
Fix preference issue
Add feature to ASX parser to add url prefix if missing
Fix make dist so that rpmbuild works again
Fix automake rules to allow --disable-schemas-install configure flag
Make requirement on GCONF optional (--without-gconf on ./configure line)
0.8.0
Add embed 'showcontrols' option and 'onendofstream' event
Add mimetypes for matroska audio and video files
Remove gthread from the list of requirements
0.7.0
Limit bitrate requests to 5 per item, should prevent CPU peg
Add in audio mp4 mime types
Add libxul-unstable checks in
Remove mozilla-plugin out of the libxul test
0.6.3
Update URL in about:plugins page
0.6.2
Add Turkish translation by Onur Küçük
Add back in "Plug-in" to QT description
Change "QuickTime Plug-in 6.0 /7" to "QuickTime 7.4.5"
Better local file handling
Detect local files and play them directly
0.6.1
Update Makefile.am to install schema file correctly
Update aclocal/automake settings
Add embedoption "enablefullscreen" works like "enablecontextmenu" to prevent user from
making the window fullscreen
No longer require libxul-embedding on F9
Remove debian files, add DOCS/tech/javascript.txt
Added Spanish translation by Festor Wailon Dacoba
0.6.0
Set start trigger to be based off of media bitrate
New trigger code works like this
Test for > 20% and over cache size
Test for 2 * cache size as long as cache size > 512
Test for downloaded amount / bitrate > 10
Trigger at either 20% of media or 2 * cache size whichever is smaller
Fix compliation problem with xulrunner on Fedora 9
0.5.4
Fix .h generation problem
Add support for tv:// type devices
Change "Windows Media Player Plugin" to "Windows Media Player Plug-in"
0.5.3
Added Polish translation
Print Error on unable to launch gnome-mplayer
Increase URL buffer from 1K to 4K
Added pt_BR language
Set Copy Url eariler in the code, so that you can copy the url before 20% buffer
Fix problem with uninitialized width and height and NP_FULL media
0.5.2
Add French translation
Add javascript src attribute
Fix for BBC radio to work
Turn off forcing of streaming for flash media
More work on realplayer emulation
0.5.1
Implement several WMP controls methods
Tell the player what URL we are getting the data from via SetURL
Cleanup K/s display to show only tenths, also make sure we use floating point math
A K/s info while caching for non-streaming data
New dbus callback "ReloadPlugins" tells browser to reload its plugin settings
Allow configuration of plugins by setting from gconf
In send_signal_when_ready change the sleep to a smaller value and then only try 100 times before dropping out
Implement PlayPause JS method
Remove custom dbus dispatcher for Opera, doesn't seem to be needed
Make sure dbus dispatcher is stopped
Use private dbus connection
0.5.0
If mimetype is video/x-flv then mark the media as streaming
Version sync with gnome-mplayer
Handle more javascript methods, that allow setting callbacks on events
Make qtsrc locations work, makes some apple sites work
Add configure option --disable-caching, which never uses local storage for the media cache
If cache size from gnome-mplayer is 0, set media to streaming
Fix several bugs in dbus event processor
Add the ability to set the onClick callback via a javascript method
0.0.7
Add "debug" option to the embed tag so that we can watch output in certain test cases
Detect ICY streams on download and switch them to streaming media
Add embed command 'NoCache'
Callback event "onDestroy"
Add support for option "enableContextMenu"
Add more callback events onmouseclick, onmousedown, onmouseup, onmouseover, onmouseout
GUI message improvements
Implement MediaComplete event and callback
Implement Event handling from gnome-mplayer
Added video/x-m4v mimetype, made a video at arstechnica work.
Slow down the cache update messages to only 1 per 1/2 second
Fix SetWindow return value, helps Opera some
More safety checks in Write method
Don't allow NULL filename
When opening the media and no window has been set, tell gnome-mplayer to run hidden
Fix problem with looping
QuickTime Media Link Parsing Support now plays http://movies.yahoo.com/feature/transformers.html
0.0.6
Debian-ized the package
Another ASX fix, strip out invalid unicode characters
More work on the ASX parser to handle XMLish URLs and not break
Fix ASX parser to increment the entry pointer when we encounter a entry tag
This used for single ASX files where the entry entity contains several
ref tags all pointing to the same content
Fix ASX parser to handle entryrefs which basically is a url to another
asx file that contains the same media at different sites (mirrors)
If the local version of the url is requested but not found then use the url as the source
Handle request for "Next" item off the playlist differently
Implement ASX parser and extract the ASX fields out
Switch from using dbus_connection_setup_with_g_main to
using our own dbus dispatcher but only when we can't connect to
g_main_loop. Fixes some trailers in Opera and in Firefox
0.0.5 (Not released)
Create autobuilding spec file
Fix doc location
Make quicktime autohref urls work
Version bump
0.0.4
Fix looping problem and initialization
Mark cancelled player as not ready
Marked cancelled items as not opened
Fix problem with request_*_value methods using wrong dest
Handle Cancel signal from player
Change request calls to use unique (based on controlid) object names
Remove unnecessary glib flushes
Trap several instance = NULL cases
Fix problem where window is destroyed immediately
Fix NULL pointer problem in several places
Put xpt files in place that browser can find them
Bump version
Make Apple HD trailers cache properly
When sending command, check for control id on item and then use instance
Handle "filename" embed tag
Implement GetLoop, SetLoop and loop embed tag methods
Implement GetMIMEType JS Method
Fix problem when starting an hrefid and over cache
0.0.3 Mar 12, 2007
Fix up install issues
Switch to using controlid when using GNOME MPlayer allows control of hidden windows
Fix infinite loop problem when hidden=true
Fix problem where streaming media not started when hidden
Fix problem with non-streaming media not playing when hidden
Use cache setting from GNOME MPlayer so now play amount cached > cache_size * 1024
Set cache percent value
Start playing when cache percent is > 20% and amount cached is > 2000K
Fixed a bug when the player is not launched and open is called, plugin would spin forever
Add javascript methods
ShowControls
Fullscreen
Seek
FF/FastForward
Rew/Rewind/FastReverse
GetVolume
GetFullScreen
GetShowControls
SetVolume
GetTime
GetDuration
GetPercent
Fix firefox-xpcom not being included with firefox 2.0.0.2
0.0.2
Cleanup some of the chattyness
Implement signal handlers for signals: RequestById, Next
Add wrappers for dbus signals, makes calling things simpler
Implement qt reference file parseing, makes non-HD Apple trailers work
Make Apple HD Trailer work (caching still a problem)
Make HREF links work, when coming back to same player
0.0.1 Feb 19,2007
Initial release
gecko-mediaplayer-1.0.8/ltmain.sh 0000755 0001750 0001750 00000733055 11212767236 013672 0000000 0000000 # Generated from ltmain.m4sh.
# ltmain.sh (GNU libtool) 2.2.6
# Written by Gordon Matzigkeit , 1996
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# GNU Libtool is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# As a special exception to the GNU General Public License,
# if you distribute this file as part of a program or library that
# is built using GNU Libtool, you may include this file under the
# same distribution terms that you use for the rest of that program.
#
# GNU Libtool is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Usage: $progname [OPTION]... [MODE-ARG]...
#
# Provide generalized library-building support services.
#
# --config show all configuration variables
# --debug enable verbose shell tracing
# -n, --dry-run display commands without modifying any files
# --features display basic configuration information and exit
# --mode=MODE use operation mode MODE
# --preserve-dup-deps don't remove duplicate dependency libraries
# --quiet, --silent don't print informational messages
# --tag=TAG use configuration variables from tag TAG
# -v, --verbose print informational messages (default)
# --version print version information
# -h, --help print short or long help message
#
# MODE must be one of the following:
#
# clean remove files from the build directory
# compile compile a source file into a libtool object
# execute automatically set library path, then run a program
# finish complete the installation of libtool libraries
# install install libraries or executables
# link create a library or an executable
# uninstall remove libraries from an installed directory
#
# MODE-ARGS vary depending on the MODE.
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
#
# When reporting a bug, please describe a test case to reproduce it and
# include the following information:
#
# host-triplet: $host
# shell: $SHELL
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
# $progname: (GNU libtool) 2.2.6
# automake: $automake_version
# autoconf: $autoconf_version
#
# Report bugs to .
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=2.2.6
TIMESTAMP=""
package_revision=1.3012
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# NLS nuisances: We save the old values to restore during execute mode.
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
lt_user_locale=
lt_safe_locale=
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test \"\${$lt_var+set}\" = set; then
save_$lt_var=\$$lt_var
$lt_var=C
export $lt_var
lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
fi"
done
$lt_unset CDPATH
: ${CP="cp -f"}
: ${ECHO="echo"}
: ${EGREP="/bin/grep -E"}
: ${FGREP="/bin/grep -F"}
: ${GREP="/bin/grep"}
: ${LN_S="ln -s"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
: ${SED="/bin/sed"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}
# Global variables:
EXIT_SUCCESS=0
EXIT_FAILURE=1
EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
exit_status=$EXIT_SUCCESS
# Make sure IFS has a sensible default
lt_nl='
'
IFS=" $lt_nl"
dirname="s,/[^/]*$,,"
basename="s,^.*/,,"
# func_dirname_and_basename file append nondir_replacement
# perform func_basename and func_dirname in a single function
# call:
# dirname: Compute the dirname of FILE. If nonempty,
# add APPEND to the result, otherwise set result
# to NONDIR_REPLACEMENT.
# value returned in "$func_dirname_result"
# basename: Compute filename of FILE.
# value retuned in "$func_basename_result"
# Implementation must be kept synchronized with func_dirname
# and func_basename. For efficiency, we do not delegate to
# those functions but instead duplicate the functionality here.
func_dirname_and_basename ()
{
# Extract subdirectory from the argument.
func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
if test "X$func_dirname_result" = "X${1}"; then
func_dirname_result="${3}"
else
func_dirname_result="$func_dirname_result${2}"
fi
func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
}
# Generated shell functions inserted here.
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
# is ksh but when the shell is invoked as "sh" and the current value of
# the _XPG environment variable is not equal to 1 (one), the special
# positional parameter $0, within a function call, is the name of the
# function.
progpath="$0"
# The name of this program:
# In the unlikely event $progname began with a '-', it would play havoc with
# func_echo (imagine progname=-n), so we prepend ./ in that case:
func_dirname_and_basename "$progpath"
progname=$func_basename_result
case $progname in
-*) progname=./$progname ;;
esac
# Make sure we have an absolute path for reexecution:
case $progpath in
[\\/]*|[A-Za-z]:\\*) ;;
*[\\/]*)
progdir=$func_dirname_result
progdir=`cd "$progdir" && pwd`
progpath="$progdir/$progname"
;;
*)
save_IFS="$IFS"
IFS=:
for progdir in $PATH; do
IFS="$save_IFS"
test -x "$progdir/$progname" && break
done
IFS="$save_IFS"
test -n "$progdir" || progdir=`pwd`
progpath="$progdir/$progname"
;;
esac
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
# Same as above, but do not quote variable references.
double_quote_subst='s/\(["`\\]\)/\\\1/g'
# Re-`\' parameter expansions in output of double_quote_subst that were
# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
# in input to double_quote_subst, that '$' was protected from expansion.
# Since each input `\' is now two `\'s, look for any number of runs of
# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
bs='\\'
bs2='\\\\'
bs4='\\\\\\\\'
dollar='\$'
sed_double_backslash="\
s/$bs4/&\\
/g
s/^$bs2$dollar/$bs&/
s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
s/\n//g"
# Standard options:
opt_dry_run=false
opt_help=false
opt_quiet=false
opt_verbose=false
opt_warning=:
# func_echo arg...
# Echo program name prefixed message, along with the current mode
# name if it has been set yet.
func_echo ()
{
$ECHO "$progname${mode+: }$mode: $*"
}
# func_verbose arg...
# Echo program name prefixed message in verbose mode only.
func_verbose ()
{
$opt_verbose && func_echo ${1+"$@"}
# A bug in bash halts the script if the last line of a function
# fails when set -e is in force, so we need another command to
# work around that:
:
}
# func_error arg...
# Echo program name prefixed message to standard error.
func_error ()
{
$ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
}
# func_warning arg...
# Echo program name prefixed warning message to standard error.
func_warning ()
{
$opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
# bash bug again:
:
}
# func_fatal_error arg...
# Echo program name prefixed message to standard error, and exit.
func_fatal_error ()
{
func_error ${1+"$@"}
exit $EXIT_FAILURE
}
# func_fatal_help arg...
# Echo program name prefixed message to standard error, followed by
# a help hint, and exit.
func_fatal_help ()
{
func_error ${1+"$@"}
func_fatal_error "$help"
}
help="Try \`$progname --help' for more information." ## default
# func_grep expression filename
# Check whether EXPRESSION matches any line of FILENAME, without output.
func_grep ()
{
$GREP "$1" "$2" >/dev/null 2>&1
}
# func_mkdir_p directory-path
# Make sure the entire path to DIRECTORY-PATH is available.
func_mkdir_p ()
{
my_directory_path="$1"
my_dir_list=
if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
# Protect directory names starting with `-'
case $my_directory_path in
-*) my_directory_path="./$my_directory_path" ;;
esac
# While some portion of DIR does not yet exist...
while test ! -d "$my_directory_path"; do
# ...make a list in topmost first order. Use a colon delimited
# list incase some portion of path contains whitespace.
my_dir_list="$my_directory_path:$my_dir_list"
# If the last portion added has no slash in it, the list is done
case $my_directory_path in */*) ;; *) break ;; esac
# ...otherwise throw away the child directory and loop
my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
done
my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
save_mkdir_p_IFS="$IFS"; IFS=':'
for my_dir in $my_dir_list; do
IFS="$save_mkdir_p_IFS"
# mkdir can fail with a `File exist' error if two processes
# try to create one of the directories concurrently. Don't
# stop in that case!
$MKDIR "$my_dir" 2>/dev/null || :
done
IFS="$save_mkdir_p_IFS"
# Bail out if we (or some other process) failed to create a directory.
test -d "$my_directory_path" || \
func_fatal_error "Failed to create \`$1'"
fi
}
# func_mktempdir [string]
# Make a temporary directory that won't clash with other running
# libtool processes, and avoids race conditions if possible. If
# given, STRING is the basename for that directory.
func_mktempdir ()
{
my_template="${TMPDIR-/tmp}/${1-$progname}"
if test "$opt_dry_run" = ":"; then
# Return a directory name, but don't create it in dry-run mode
my_tmpdir="${my_template}-$$"
else
# If mktemp works, use that first and foremost
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
if test ! -d "$my_tmpdir"; then
# Failing that, at least try and use $RANDOM to avoid a race
my_tmpdir="${my_template}-${RANDOM-0}$$"
save_mktempdir_umask=`umask`
umask 0077
$MKDIR "$my_tmpdir"
umask $save_mktempdir_umask
fi
# If we're not in dry-run mode, bomb out on failure
test -d "$my_tmpdir" || \
func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
fi
$ECHO "X$my_tmpdir" | $Xsed
}
# func_quote_for_eval arg
# Aesthetically quote ARG to be evaled later.
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
# is double-quoted, suitable for a subsequent eval, whereas
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
# which are still active within double quotes backslashified.
func_quote_for_eval ()
{
case $1 in
*[\\\`\"\$]*)
func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
*)
func_quote_for_eval_unquoted_result="$1" ;;
esac
case $func_quote_for_eval_unquoted_result in
# Double-quote args containing shell metacharacters to delay
# word splitting, command substitution and and variable
# expansion for a subsequent eval.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
;;
*)
func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
esac
}
# func_quote_for_expand arg
# Aesthetically quote ARG to be evaled later; same as above,
# but do not quote variable references.
func_quote_for_expand ()
{
case $1 in
*[\\\`\"]*)
my_arg=`$ECHO "X$1" | $Xsed \
-e "$double_quote_subst" -e "$sed_double_backslash"` ;;
*)
my_arg="$1" ;;
esac
case $my_arg in
# Double-quote args containing shell metacharacters to delay
# word splitting and command substitution for a subsequent eval.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
my_arg="\"$my_arg\""
;;
esac
func_quote_for_expand_result="$my_arg"
}
# func_show_eval cmd [fail_exp]
# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.
func_show_eval ()
{
my_cmd="$1"
my_fail_exp="${2-:}"
${opt_silent-false} || {
func_quote_for_expand "$my_cmd"
eval "func_echo $func_quote_for_expand_result"
}
if ${opt_dry_run-false}; then :; else
eval "$my_cmd"
my_status=$?
if test "$my_status" -eq 0; then :; else
eval "(exit $my_status); $my_fail_exp"
fi
fi
}
# func_show_eval_locale cmd [fail_exp]
# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it. Use the saved locale for evaluation.
func_show_eval_locale ()
{
my_cmd="$1"
my_fail_exp="${2-:}"
${opt_silent-false} || {
func_quote_for_expand "$my_cmd"
eval "func_echo $func_quote_for_expand_result"
}
if ${opt_dry_run-false}; then :; else
eval "$lt_user_locale
$my_cmd"
my_status=$?
eval "$lt_safe_locale"
if test "$my_status" -eq 0; then :; else
eval "(exit $my_status); $my_fail_exp"
fi
fi
}
# func_version
# Echo version message to standard output and exit.
func_version ()
{
$SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
s/^# //
s/^# *$//
s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
p
}' < "$progpath"
exit $?
}
# func_usage
# Echo short help message to standard output and exit.
func_usage ()
{
$SED -n '/^# Usage:/,/# -h/ {
s/^# //
s/^# *$//
s/\$progname/'$progname'/
p
}' < "$progpath"
$ECHO
$ECHO "run \`$progname --help | more' for full usage"
exit $?
}
# func_help
# Echo long help message to standard output and exit.
func_help ()
{
$SED -n '/^# Usage:/,/# Report bugs to/ {
s/^# //
s/^# *$//
s*\$progname*'$progname'*
s*\$host*'"$host"'*
s*\$SHELL*'"$SHELL"'*
s*\$LTCC*'"$LTCC"'*
s*\$LTCFLAGS*'"$LTCFLAGS"'*
s*\$LD*'"$LD"'*
s/\$with_gnu_ld/'"$with_gnu_ld"'/
s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
p
}' < "$progpath"
exit $?
}
# func_missing_arg argname
# Echo program name prefixed message to standard error and set global
# exit_cmd.
func_missing_arg ()
{
func_error "missing argument for $1"
exit_cmd=exit
}
exit_cmd=:
# Check that we have a working $ECHO.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X$1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
# Yippee, $ECHO works!
:
else
# Restart under the correct shell, and then maybe $ECHO will work.
exec $SHELL "$progpath" --no-reexec ${1+"$@"}
fi
if test "X$1" = X--fallback-echo; then
# used as fallback echo
shift
cat </dev/null 2>&1; then
taglist="$taglist $tagname"
# Evaluate the configuration. Be careful to quote the path
# and the sed script, to avoid splitting on whitespace, but
# also don't use non-portable quotes within backquotes within
# quotes we have to do it in 2 steps:
extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
eval "$extractedcf"
else
func_error "ignoring unknown tag $tagname"
fi
;;
esac
}
# Parse options once, thoroughly. This comes as soon as possible in
# the script to make things like `libtool --version' happen quickly.
{
# Shorthand for --mode=foo, only valid as the first argument
case $1 in
clean|clea|cle|cl)
shift; set dummy --mode clean ${1+"$@"}; shift
;;
compile|compil|compi|comp|com|co|c)
shift; set dummy --mode compile ${1+"$@"}; shift
;;
execute|execut|execu|exec|exe|ex|e)
shift; set dummy --mode execute ${1+"$@"}; shift
;;
finish|finis|fini|fin|fi|f)
shift; set dummy --mode finish ${1+"$@"}; shift
;;
install|instal|insta|inst|ins|in|i)
shift; set dummy --mode install ${1+"$@"}; shift
;;
link|lin|li|l)
shift; set dummy --mode link ${1+"$@"}; shift
;;
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
shift; set dummy --mode uninstall ${1+"$@"}; shift
;;
esac
# Parse non-mode specific arguments:
while test "$#" -gt 0; do
opt="$1"
shift
case $opt in
--config) func_config ;;
--debug) preserve_args="$preserve_args $opt"
func_echo "enabling shell trace mode"
opt_debug='set -x'
$opt_debug
;;
-dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
execute_dlfiles="$execute_dlfiles $1"
shift
;;
--dry-run | -n) opt_dry_run=: ;;
--features) func_features ;;
--finish) mode="finish" ;;
--mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
case $1 in
# Valid mode arguments:
clean) ;;
compile) ;;
execute) ;;
finish) ;;
install) ;;
link) ;;
relink) ;;
uninstall) ;;
# Catch anything else as an error
*) func_error "invalid argument for $opt"
exit_cmd=exit
break
;;
esac
mode="$1"
shift
;;
--preserve-dup-deps)
opt_duplicate_deps=: ;;
--quiet|--silent) preserve_args="$preserve_args $opt"
opt_silent=:
;;
--verbose| -v) preserve_args="$preserve_args $opt"
opt_silent=false
;;
--tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
preserve_args="$preserve_args $opt $1"
func_enable_tag "$1" # tagname is set here
shift
;;
# Separate optargs to long options:
-dlopen=*|--mode=*|--tag=*)
func_opt_split "$opt"
set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
shift
;;
-\?|-h) func_usage ;;
--help) opt_help=: ;;
--version) func_version ;;
-*) func_fatal_help "unrecognized option \`$opt'" ;;
*) nonopt="$opt"
break
;;
esac
done
case $host in
*cygwin* | *mingw* | *pw32* | *cegcc*)
# don't eliminate duplications in $postdeps and $predeps
opt_duplicate_compiler_generated_deps=:
;;
*)
opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
;;
esac
# Having warned about all mis-specified options, bail out if
# anything was wrong.
$exit_cmd $EXIT_FAILURE
}
# func_check_version_match
# Ensure that we are using m4 macros, and libtool script from the same
# release of libtool.
func_check_version_match ()
{
if test "$package_revision" != "$macro_revision"; then
if test "$VERSION" != "$macro_version"; then
if test -z "$macro_version"; then
cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from an older release.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
else
cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
fi
else
cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
$progname: of $PACKAGE $VERSION and run autoconf again.
_LT_EOF
fi
exit $EXIT_MISMATCH
fi
}
## ----------- ##
## Main. ##
## ----------- ##
$opt_help || {
# Sanity checks first:
func_check_version_match
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
func_fatal_configuration "not configured to build any kind of library"
fi
test -z "$mode" && func_fatal_error "error: you must specify a MODE."
# Darwin sucks
eval std_shrext=\"$shrext_cmds\"
# Only execute mode is allowed to have -dlopen flags.
if test -n "$execute_dlfiles" && test "$mode" != execute; then
func_error "unrecognized option \`-dlopen'"
$ECHO "$help" 1>&2
exit $EXIT_FAILURE
fi
# Change the help message to a mode-specific one.
generic_help="$help"
help="Try \`$progname --help --mode=$mode' for more information."
}
# func_lalib_p file
# True iff FILE is a libtool `.la' library or `.lo' object file.
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_lalib_p ()
{
test -f "$1" &&
$SED -e 4q "$1" 2>/dev/null \
| $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
}
# func_lalib_unsafe_p file
# True iff FILE is a libtool `.la' library or `.lo' object file.
# This function implements the same check as func_lalib_p without
# resorting to external programs. To this end, it redirects stdin and
# closes it afterwards, without saving the original file descriptor.
# As a safety measure, use it only where a negative result would be
# fatal anyway. Works if `file' does not exist.
func_lalib_unsafe_p ()
{
lalib_p=no
if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
for lalib_p_l in 1 2 3 4
do
read lalib_p_line
case "$lalib_p_line" in
\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
esac
done
exec 0<&5 5<&-
fi
test "$lalib_p" = yes
}
# func_ltwrapper_script_p file
# True iff FILE is a libtool wrapper script
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_script_p ()
{
func_lalib_p "$1"
}
# func_ltwrapper_executable_p file
# True iff FILE is a libtool wrapper executable
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_executable_p ()
{
func_ltwrapper_exec_suffix=
case $1 in
*.exe) ;;
*) func_ltwrapper_exec_suffix=.exe ;;
esac
$GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
}
# func_ltwrapper_scriptname file
# Assumes file is an ltwrapper_executable
# uses $file to determine the appropriate filename for a
# temporary ltwrapper_script.
func_ltwrapper_scriptname ()
{
func_ltwrapper_scriptname_result=""
if func_ltwrapper_executable_p "$1"; then
func_dirname_and_basename "$1" "" "."
func_stripname '' '.exe' "$func_basename_result"
func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
fi
}
# func_ltwrapper_p file
# True iff FILE is a libtool wrapper script or wrapper executable
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_p ()
{
func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
}
# func_execute_cmds commands fail_cmd
# Execute tilde-delimited COMMANDS.
# If FAIL_CMD is given, eval that upon failure.
# FAIL_CMD may read-access the current command in variable CMD!
func_execute_cmds ()
{
$opt_debug
save_ifs=$IFS; IFS='~'
for cmd in $1; do
IFS=$save_ifs
eval cmd=\"$cmd\"
func_show_eval "$cmd" "${2-:}"
done
IFS=$save_ifs
}
# func_source file
# Source FILE, adding directory component if necessary.
# Note that it is not necessary on cygwin/mingw to append a dot to
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
# behavior happens only for exec(3), not for open(2)! Also, sourcing
# `FILE.' does not work on cygwin managed mounts.
func_source ()
{
$opt_debug
case $1 in
*/* | *\\*) . "$1" ;;
*) . "./$1" ;;
esac
}
# func_infer_tag arg
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base compile
# command doesn't match the default compiler.
# arg is usually of the form 'gcc ...'
func_infer_tag ()
{
$opt_debug
if test -n "$available_tags" && test -z "$tagname"; then
CC_quoted=
for arg in $CC; do
func_quote_for_eval "$arg"
CC_quoted="$CC_quoted $func_quote_for_eval_result"
done
case $@ in
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when configure was run.
" $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
for z in $available_tags; do
if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
CC_quoted=
for arg in $CC; do
# Double-quote args containing other shell metacharacters.
func_quote_for_eval "$arg"
CC_quoted="$CC_quoted $func_quote_for_eval_result"
done
case "$@ " in
" $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
# The compiler in the base compile command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
tagname=$z
break
;;
esac
fi
done
# If $tagname still isn't set, then no tagged configuration
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
func_echo "unable to infer tagged configuration"
func_fatal_error "specify a tag with \`--tag'"
# else
# func_verbose "using $tagname tagged configuration"
fi
;;
esac
fi
}
# func_write_libtool_object output_name pic_name nonpic_name
# Create a libtool object file (analogous to a ".la" file),
# but don't create it if we're doing a dry run.
func_write_libtool_object ()
{
write_libobj=${1}
if test "$build_libtool_libs" = yes; then
write_lobj=\'${2}\'
else
write_lobj=none
fi
if test "$build_old_libs" = yes; then
write_oldobj=\'${3}\'
else
write_oldobj=none
fi
$opt_dry_run || {
cat >${write_libobj}T <?"'"'"' &()|`$[]' \
&& func_warning "libobj name \`$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" ""
objname="$func_basename_result"
xdir="$func_dirname_result"
lobj=${xdir}$objdir/$objname
test -z "$base_compile" && \
func_fatal_help "you must specify a compilation command"
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
removelist="$obj $lobj $libobj ${libobj}T"
else
removelist="$lobj $libobj ${libobj}T"
fi
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
cygwin* | mingw* | pw32* | os2* | cegcc*)
pic_mode=default
;;
esac
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
# non-PIC code in shared libraries is not supported
pic_mode=default
fi
# Calculate the filename of the output object if compiler does
# not support -o with -c
if test "$compiler_c_o" = no; then
output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
lockfile="$output_obj.lock"
else
output_obj=
need_locks=no
lockfile=
fi
# Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file
if test "$need_locks" = yes; then
until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
func_echo "Waiting for $lockfile to be removed"
sleep 2
done
elif test "$need_locks" = warn; then
if test -f "$lockfile"; then
$ECHO "\
*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
removelist="$removelist $output_obj"
$ECHO "$srcfile" > "$lockfile"
fi
$opt_dry_run || $RM $removelist
removelist="$removelist $lockfile"
trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
if test -n "$fix_srcfile_path"; then
eval srcfile=\"$fix_srcfile_path\"
fi
func_quote_for_eval "$srcfile"
qsrcfile=$func_quote_for_eval_result
# Only build a PIC object if we are building libtool libraries.
if test "$build_libtool_libs" = yes; then
# Without this assignment, base_compile gets emptied.
fbsd_hideous_sh_bug=$base_compile
if test "$pic_mode" != no; then
command="$base_compile $qsrcfile $pic_flag"
else
# Don't build PIC code
command="$base_compile $qsrcfile"
fi
func_mkdir_p "$xdir$objdir"
if test -z "$output_obj"; then
# Place PIC objects in $objdir
command="$command -o $lobj"
fi
func_show_eval_locale "$command" \
'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
if test "$need_locks" = warn &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$ECHO "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed, then go on to compile the next one
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
func_show_eval '$MV "$output_obj" "$lobj"' \
'error=$?; $opt_dry_run || $RM $removelist; exit $error'
fi
# Allow error messages only from the first compilation.
if test "$suppress_opt" = yes; then
suppress_output=' >/dev/null 2>&1'
fi
fi
# Only build a position-dependent object if we build old libraries.
if test "$build_old_libs" = yes; then
if test "$pic_mode" != yes; then
# Don't build PIC code
command="$base_compile $qsrcfile$pie_flag"
else
command="$base_compile $qsrcfile $pic_flag"
fi
if test "$compiler_c_o" = yes; then
command="$command -o $obj"
fi
# Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output"
func_show_eval_locale "$command" \
'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
if test "$need_locks" = warn &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$ECHO "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
func_show_eval '$MV "$output_obj" "$obj"' \
'error=$?; $opt_dry_run || $RM $removelist; exit $error'
fi
fi
$opt_dry_run || {
func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
removelist=$lockfile
$RM "$lockfile"
fi
}
exit $EXIT_SUCCESS
}
$opt_help || {
test "$mode" = compile && func_mode_compile ${1+"$@"}
}
func_mode_help ()
{
# We need to display help for each of the modes.
case $mode in
"")
# Generic help is extracted from the usage comments
# at the start of this file.
func_help
;;
clean)
$ECHO \
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
Remove files from the build directory.
RM is the name of the program to use to delete files associated with each FILE
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
to RM.
If FILE is a libtool library, object or program, all the files associated
with it are deleted. Otherwise, only FILE itself is deleted using RM."
;;
compile)
$ECHO \
"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
Compile a source file into a libtool library object.
This mode accepts the following additional options:
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
-no-suppress do not suppress compiler output for multiple passes
-prefer-pic try to building PIC objects only
-prefer-non-pic try to building non-PIC objects only
-shared do not build a \`.o' file suitable for static linking
-static only build a \`.o' file suitable for static linking
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
from the given SOURCEFILE.
The output file name is determined by removing the directory component from
SOURCEFILE, then substituting the C source code suffix \`.c' with the
library object suffix, \`.lo'."
;;
execute)
$ECHO \
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
Automatically set library path, then run a program.
This mode accepts the following additional options:
-dlopen FILE add the directory containing FILE to the library path
This mode sets the library path environment variable according to \`-dlopen'
flags.
If any of the ARGS are libtool executable wrappers, then they are translated
into their corresponding uninstalled binary, and any of their required library
directories are added to the library path.
Then, COMMAND is executed, with ARGS as arguments."
;;
finish)
$ECHO \
"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
Complete the installation of libtool libraries.
Each LIBDIR is a directory that contains libtool libraries.
The commands that this mode executes may require superuser privileges. Use
the \`--dry-run' option if you just want to see what would be executed."
;;
install)
$ECHO \
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
Install executables or libraries.
INSTALL-COMMAND is the installation command. The first component should be
either the \`install' or \`cp' program.
The following components of INSTALL-COMMAND are treated specially:
-inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
The rest of the components are interpreted as arguments to that command (only
BSD-compatible install options are recognized)."
;;
link)
$ECHO \
"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
Link object files or libraries together to form another library, or to
create an executable program.
LINK-COMMAND is a command using the C compiler that you would use to create
a program from several object files.
The following components of LINK-COMMAND are treated specially:
-all-static do not do any dynamic linking at all
-avoid-version do not add a version suffix if possible
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX
try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
-no-fast-install disable the fast-install mode
-no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
-objectlist FILE Use a list of object files found in FILE to specify objects
-precious-files-regex REGEX
don't remove output files matching REGEX
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
-shared only do dynamic linking of libtool libraries
-shrext SUFFIX override the standard shared library file extension
-static do not do any dynamic linking of uninstalled libtool libraries
-static-libtool-libs
do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0]
-weak LIBNAME declare that the target provides the LIBNAME interface
All other options (arguments beginning with \`-') are ignored.
Every other argument is treated as a filename. Files ending in \`.la' are
treated as uninstalled libtool libraries, other files are standard or library
object files.
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
only library objects (\`.lo' files) may be specified, and \`-rpath' is
required, except when creating a convenience library.
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
using \`ar' and \`ranlib', or on Windows using \`lib'.
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
is created, otherwise an executable program is created."
;;
uninstall)
$ECHO \
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
Remove libraries from an installation directory.
RM is the name of the program to use to delete files associated with each FILE
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
to RM.
If FILE is a libtool library, all the files associated with it are deleted.
Otherwise, only FILE itself is deleted using RM."
;;
*)
func_fatal_help "invalid operation mode \`$mode'"
;;
esac
$ECHO
$ECHO "Try \`$progname --help' for more information about other modes."
exit $?
}
# Now that we've collected a possible --mode arg, show help if necessary
$opt_help && func_mode_help
# func_mode_execute arg...
func_mode_execute ()
{
$opt_debug
# The first argument is the command name.
cmd="$nonopt"
test -z "$cmd" && \
func_fatal_help "you must specify a COMMAND"
# Handle -dlopen flags immediately.
for file in $execute_dlfiles; do
test -f "$file" \
|| func_fatal_help "\`$file' is not a file"
dir=
case $file in
*.la)
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
|| func_fatal_help "\`$lib' is not a valid libtool archive"
# Read the libtool library.
dlname=
library_names=
func_source "$file"
# Skip this library if it cannot be dlopened.
if test -z "$dlname"; then
# Warn if it was a shared library.
test -n "$library_names" && \
func_warning "\`$file' was not linked with \`-export-dynamic'"
continue
fi
func_dirname "$file" "" "."
dir="$func_dirname_result"
if test -f "$dir/$objdir/$dlname"; then
dir="$dir/$objdir"
else
if test ! -f "$dir/$dlname"; then
func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
fi
fi
;;
*.lo)
# Just add the directory containing the .lo file.
func_dirname "$file" "" "."
dir="$func_dirname_result"
;;
*)
func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
continue
;;
esac
# Get the absolute pathname.
absdir=`cd "$dir" && pwd`
test -n "$absdir" && dir="$absdir"
# Now add the directory to shlibpath_var.
if eval "test -z \"\$$shlibpath_var\""; then
eval "$shlibpath_var=\"\$dir\""
else
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
fi
done
# This variable tells wrapper scripts just to set shlibpath_var
# rather than running their programs.
libtool_execute_magic="$magic"
# Check if any of the arguments is a wrapper script.
args=
for file
do
case $file in
-*) ;;
*)
# Do a test to see if this is really a libtool program.
if func_ltwrapper_script_p "$file"; then
func_source "$file"
# Transform arg to wrapped name.
file="$progdir/$program"
elif func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
func_source "$func_ltwrapper_scriptname_result"
# Transform arg to wrapped name.
file="$progdir/$program"
fi
;;
esac
# Quote arguments (to preserve shell metacharacters).
func_quote_for_eval "$file"
args="$args $func_quote_for_eval_result"
done
if test "X$opt_dry_run" = Xfalse; then
if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
fi
# Restore saved environment variables
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test \"\${save_$lt_var+set}\" = set; then
$lt_var=\$save_$lt_var; export $lt_var
else
$lt_unset $lt_var
fi"
done
# Now prepare to actually exec the command.
exec_cmd="\$cmd$args"
else
# Display what would be done.
if test -n "$shlibpath_var"; then
eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
$ECHO "export $shlibpath_var"
fi
$ECHO "$cmd$args"
exit $EXIT_SUCCESS
fi
}
test "$mode" = execute && func_mode_execute ${1+"$@"}
# func_mode_finish arg...
func_mode_finish ()
{
$opt_debug
libdirs="$nonopt"
admincmds=
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
for dir
do
libdirs="$libdirs $dir"
done
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
'"$cmd"'"'
fi
if test -n "$finish_eval"; then
# Do the single finish_eval.
eval cmds=\"$finish_eval\"
$opt_dry_run || eval "$cmds" || admincmds="$admincmds
$cmds"
fi
done
fi
# Exit here if they wanted silent mode.
$opt_silent && exit $EXIT_SUCCESS
$ECHO "X----------------------------------------------------------------------" | $Xsed
$ECHO "Libraries have been installed in:"
for libdir in $libdirs; do
$ECHO " $libdir"
done
$ECHO
$ECHO "If you ever happen to want to link against installed libraries"
$ECHO "in a given directory, LIBDIR, you must either use libtool, and"
$ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
$ECHO "flag during linking and do at least one of the following:"
if test -n "$shlibpath_var"; then
$ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
$ECHO " during execution"
fi
if test -n "$runpath_var"; then
$ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
$ECHO " during linking"
fi
if test -n "$hardcode_libdir_flag_spec"; then
libdir=LIBDIR
eval flag=\"$hardcode_libdir_flag_spec\"
$ECHO " - use the \`$flag' linker flag"
fi
if test -n "$admincmds"; then
$ECHO " - have your system administrator run these commands:$admincmds"
fi
if test -f /etc/ld.so.conf; then
$ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
fi
$ECHO
$ECHO "See any operating system documentation about shared libraries for"
case $host in
solaris2.[6789]|solaris2.1[0-9])
$ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
$ECHO "pages."
;;
*)
$ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
;;
esac
$ECHO "X----------------------------------------------------------------------" | $Xsed
exit $EXIT_SUCCESS
}
test "$mode" = finish && func_mode_finish ${1+"$@"}
# func_mode_install arg...
func_mode_install ()
{
$opt_debug
# There may be an optional sh(1) argument at the beginning of
# install_prog (especially on Windows NT).
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
# Allow the use of GNU shtool's install command.
$ECHO "X$nonopt" | $GREP shtool >/dev/null; then
# Aesthetically quote it.
func_quote_for_eval "$nonopt"
install_prog="$func_quote_for_eval_result "
arg=$1
shift
else
install_prog=
arg=$nonopt
fi
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
func_quote_for_eval "$arg"
install_prog="$install_prog$func_quote_for_eval_result"
# We need to accept at least all the BSD install flags.
dest=
files=
opts=
prev=
install_type=
isdir=no
stripme=
for arg
do
if test -n "$dest"; then
files="$files $dest"
dest=$arg
continue
fi
case $arg in
-d) isdir=yes ;;
-f)
case " $install_prog " in
*[\\\ /]cp\ *) ;;
*) prev=$arg ;;
esac
;;
-g | -m | -o)
prev=$arg
;;
-s)
stripme=" -s"
continue
;;
-*)
;;
*)
# If the previous option needed an argument, then skip it.
if test -n "$prev"; then
prev=
else
dest=$arg
continue
fi
;;
esac
# Aesthetically quote the argument.
func_quote_for_eval "$arg"
install_prog="$install_prog $func_quote_for_eval_result"
done
test -z "$install_prog" && \
func_fatal_help "you must specify an install program"
test -n "$prev" && \
func_fatal_help "the \`$prev' option requires an argument"
if test -z "$files"; then
if test -z "$dest"; then
func_fatal_help "no file or destination specified"
else
func_fatal_help "you must specify a destination"
fi
fi
# Strip any trailing slash from the destination.
func_stripname '' '/' "$dest"
dest=$func_stripname_result
# Check to see that the destination is a directory.
test -d "$dest" && isdir=yes
if test "$isdir" = yes; then
destdir="$dest"
destname=
else
func_dirname_and_basename "$dest" "" "."
destdir="$func_dirname_result"
destname="$func_basename_result"
# Not a directory, so check to see that there is only one file specified.
set dummy $files; shift
test "$#" -gt 1 && \
func_fatal_help "\`$dest' is not a directory"
fi
case $destdir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
for file in $files; do
case $file in
*.lo) ;;
*)
func_fatal_help "\`$destdir' must be an absolute directory name"
;;
esac
done
;;
esac
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic="$magic"
staticlibs=
future_libdirs=
current_libdirs=
for file in $files; do
# Do each installation.
case $file in
*.$libext)
# Do the static libraries later.
staticlibs="$staticlibs $file"
;;
*.la)
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
|| func_fatal_help "\`$file' is not a valid libtool archive"
library_names=
old_library=
relink_command=
func_source "$file"
# Add the libdir to current_libdirs if it is the destination.
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
*" $libdir "*) ;;
*) current_libdirs="$current_libdirs $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
*" $libdir "*) ;;
*) future_libdirs="$future_libdirs $libdir" ;;
esac
fi
func_dirname "$file" "/" ""
dir="$func_dirname_result"
dir="$dir$objdir"
if test -n "$relink_command"; then
# Determine the prefix the user has applied to our future dir.
inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
# are installed to the same prefix.
# At present, this check doesn't affect windows .dll's that
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
test "$inst_prefix_dir" = "$destdir" && \
func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
else
relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
fi
func_warning "relinking \`$file'"
func_show_eval "$relink_command" \
'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
fi
# See the names of the shared library.
set dummy $library_names; shift
if test -n "$1"; then
realname="$1"
shift
srcname="$realname"
test -n "$relink_command" && srcname="$realname"T
# Install the shared library and build the symlinks.
func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
'exit $?'
tstripme="$stripme"
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
case $realname in
*.dll.a)
tstripme=""
;;
esac
;;
esac
if test -n "$tstripme" && test -n "$striplib"; then
func_show_eval "$striplib $destdir/$realname" 'exit $?'
fi
if test "$#" -gt 0; then
# Delete the old symlinks, and create new ones.
# Try `ln -sf' first, because the `ln' binary might depend on
# the symlink we replace! Solaris /bin/ln does not understand -f,
# so we also need to try rm && ln -s.
for linkname
do
test "$linkname" != "$realname" \
&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
done
fi
# Do each command in the postinstall commands.
lib="$destdir/$realname"
func_execute_cmds "$postinstall_cmds" 'exit $?'
fi
# Install the pseudo-library for information purposes.
func_basename "$file"
name="$func_basename_result"
instname="$dir/$name"i
func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
# Maybe install the static library, too.
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
;;
*.lo)
# Install (i.e. copy) a libtool object.
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile="$destdir/$destname"
else
func_basename "$file"
destfile="$func_basename_result"
destfile="$destdir/$destfile"
fi
# Deduce the name of the destination old-style object file.
case $destfile in
*.lo)
func_lo2o "$destfile"
staticdest=$func_lo2o_result
;;
*.$objext)
staticdest="$destfile"
destfile=
;;
*)
func_fatal_help "cannot copy a libtool object to \`$destfile'"
;;
esac
# Install the libtool object if requested.
test -n "$destfile" && \
func_show_eval "$install_prog $file $destfile" 'exit $?'
# Install the old object if enabled.
if test "$build_old_libs" = yes; then
# Deduce the name of the old-style object file.
func_lo2o "$file"
staticobj=$func_lo2o_result
func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
fi
exit $EXIT_SUCCESS
;;
*)
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile="$destdir/$destname"
else
func_basename "$file"
destfile="$func_basename_result"
destfile="$destdir/$destfile"
fi
# If the file is missing, and there is a .exe on the end, strip it
# because it is most likely a libtool script we actually want to
# install
stripped_ext=""
case $file in
*.exe)
if test ! -f "$file"; then
func_stripname '' '.exe' "$file"
file=$func_stripname_result
stripped_ext=".exe"
fi
;;
esac
# Do a test to see if this is really a libtool program.
case $host in
*cygwin* | *mingw*)
if func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
wrapper=$func_ltwrapper_scriptname_result
else
func_stripname '' '.exe' "$file"
wrapper=$func_stripname_result
fi
;;
*)
wrapper=$file
;;
esac
if func_ltwrapper_script_p "$wrapper"; then
notinst_deplibs=
relink_command=
func_source "$wrapper"
# Check the variables that should have been set.
test -z "$generated_by_libtool_version" && \
func_fatal_error "invalid libtool wrapper script \`$wrapper'"
finalize=yes
for lib in $notinst_deplibs; do
# Check to see that each library is installed.
libdir=
if test -f "$lib"; then
func_source "$lib"
fi
libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
if test -n "$libdir" && test ! -f "$libfile"; then
func_warning "\`$lib' has not been installed in \`$libdir'"
finalize=no
fi
done
relink_command=
func_source "$wrapper"
outputname=
if test "$fast_install" = no && test -n "$relink_command"; then
$opt_dry_run || {
if test "$finalize" = yes; then
tmpdir=`func_mktempdir`
func_basename "$file$stripped_ext"
file="$func_basename_result"
outputname="$tmpdir/$file"
# Replace the output file specification.
relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
$opt_silent || {
func_quote_for_expand "$relink_command"
eval "func_echo $func_quote_for_expand_result"
}
if eval "$relink_command"; then :
else
func_error "error: relink \`$file' with the above command before installing it"
$opt_dry_run || ${RM}r "$tmpdir"
continue
fi
file="$outputname"
else
func_warning "cannot relink \`$file'"
fi
}
else
# Install the binary that we compiled earlier.
file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
fi
fi
# remove .exe since cygwin /usr/bin/install will append another
# one anyway
case $install_prog,$host in
*/usr/bin/install*,*cygwin*)
case $file:$destfile in
*.exe:*.exe)
# this is ok
;;
*.exe:*)
destfile=$destfile.exe
;;
*:*.exe)
func_stripname '' '.exe' "$destfile"
destfile=$func_stripname_result
;;
esac
;;
esac
func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
$opt_dry_run || if test -n "$outputname"; then
${RM}r "$tmpdir"
fi
;;
esac
done
for file in $staticlibs; do
func_basename "$file"
name="$func_basename_result"
# Set up the ranlib parameters.
oldlib="$destdir/$name"
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
if test -n "$stripme" && test -n "$old_striplib"; then
func_show_eval "$old_striplib $oldlib" 'exit $?'
fi
# Do each command in the postinstall commands.
func_execute_cmds "$old_postinstall_cmds" 'exit $?'
done
test -n "$future_libdirs" && \
func_warning "remember to run \`$progname --finish$future_libdirs'"
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
$opt_dry_run && current_libdirs=" -n$current_libdirs"
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
else
exit $EXIT_SUCCESS
fi
}
test "$mode" = install && func_mode_install ${1+"$@"}
# func_generate_dlsyms outputname originator pic_p
# Extract symbols from dlprefiles and create ${outputname}S.o with
# a dlpreopen symbol table.
func_generate_dlsyms ()
{
$opt_debug
my_outputname="$1"
my_originator="$2"
my_pic_p="${3-no}"
my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
my_dlsyms=
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
if test -n "$NM" && test -n "$global_symbol_pipe"; then
my_dlsyms="${my_outputname}S.c"
else
func_error "not configured to extract global symbols from dlpreopened files"
fi
fi
if test -n "$my_dlsyms"; then
case $my_dlsyms in
"") ;;
*.c)
# Discover the nlist of each of the dlfiles.
nlist="$output_objdir/${my_outputname}.nm"
func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
# Parse the name list into a source file.
func_verbose "creating $output_objdir/$my_dlsyms"
$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
#ifdef __cplusplus
extern \"C\" {
#endif
/* External symbol declarations for the compiler. */\
"
if test "$dlself" = yes; then
func_verbose "generating symbol list for \`$output'"
$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
# Add our own program objects to the symbol list.
progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
for progfile in $progfiles; do
func_verbose "extracting global C symbols from \`$progfile'"
$opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
done
if test -n "$exclude_expsyms"; then
$opt_dry_run || {
eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
}
fi
if test -n "$export_symbols_regex"; then
$opt_dry_run || {
eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
}
fi
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
export_symbols="$output_objdir/$outputname.exp"
$opt_dry_run || {
$RM $export_symbols
eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
case $host in
*cygwin* | *mingw* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
;;
esac
}
else
$opt_dry_run || {
eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
case $host in
*cygwin | *mingw* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
;;
esac
}
fi
fi
for dlprefile in $dlprefiles; do
func_verbose "extracting global C symbols from \`$dlprefile'"
func_basename "$dlprefile"
name="$func_basename_result"
$opt_dry_run || {
eval '$ECHO ": $name " >> "$nlist"'
eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
}
done
$opt_dry_run || {
# Make sure we have at least an empty file.
test -f "$nlist" || : > "$nlist"
if test -n "$exclude_expsyms"; then
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
$MV "$nlist"T "$nlist"
fi
# Try sorting and uniquifying the output.
if $GREP -v "^: " < "$nlist" |
if sort -k 3 /dev/null 2>&1; then
sort -k 3
else
sort +2
fi |
uniq > "$nlist"S; then
:
else
$GREP -v "^: " < "$nlist" > "$nlist"S
fi
if test -f "$nlist"S; then
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
else
$ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
fi
$ECHO >> "$output_objdir/$my_dlsyms" "\
/* The mapping between symbol names and symbols. */
typedef struct {
const char *name;
void *address;
} lt_dlsymlist;
"
case $host in
*cygwin* | *mingw* | *cegcc* )
$ECHO >> "$output_objdir/$my_dlsyms" "\
/* DATA imports from DLLs on WIN32 con't be const, because
runtime relocations are performed -- see ld's documentation
on pseudo-relocs. */"
lt_dlsym_const= ;;
*osf5*)
echo >> "$output_objdir/$my_dlsyms" "\
/* This system does not cope well with relocations in const data */"
lt_dlsym_const= ;;
*)
lt_dlsym_const=const ;;
esac
$ECHO >> "$output_objdir/$my_dlsyms" "\
extern $lt_dlsym_const lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[];
$lt_dlsym_const lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[] =
{\
{ \"$my_originator\", (void *) 0 },"
case $need_lib_prefix in
no)
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
;;
*)
eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
;;
esac
$ECHO >> "$output_objdir/$my_dlsyms" "\
{0, (void *) 0}
};
/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt_${my_prefix}_LTX_preloaded_symbols;
}
#endif
#ifdef __cplusplus
}
#endif\
"
} # !$opt_dry_run
pic_flag_for_symtable=
case "$compile_command " in
*" -static "*) ;;
*)
case $host in
# compiling the symbol table file with pic_flag works around
# a FreeBSD bug that causes programs to crash when -lm is
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
*-*-hpux*)
pic_flag_for_symtable=" $pic_flag" ;;
*)
if test "X$my_pic_p" != Xno; then
pic_flag_for_symtable=" $pic_flag"
fi
;;
esac
;;
esac
symtab_cflags=
for arg in $LTCFLAGS; do
case $arg in
-pie | -fpie | -fPIE) ;;
*) symtab_cflags="$symtab_cflags $arg" ;;
esac
done
# Now compile the dynamic symbol file.
func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
# Clean up the generated files.
func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
# Transform the symbol file into the correct name.
symfileobj="$output_objdir/${my_outputname}S.$objext"
case $host in
*cygwin* | *mingw* | *cegcc* )
if test -f "$output_objdir/$my_outputname.def"; then
compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
else
compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
fi
;;
*)
compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
;;
esac
;;
*)
func_fatal_error "unknown suffix for \`$my_dlsyms'"
;;
esac
else
# We keep going just in case the user didn't refer to
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
# really was required.
# Nullify the symbol file.
compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
}
# func_win32_libid arg
# return the library type of file 'arg'
#
# Need a lot of goo to handle *both* DLLs and import libs
# Has to be a shell function in order to 'eat' the argument
# that is supplied when $file_magic_command is called.
func_win32_libid ()
{
$opt_debug
win32_libid_type="unknown"
win32_fileres=`file -L $1 2>/dev/null`
case $win32_fileres in
*ar\ archive\ import\ library*) # definitely import
win32_libid_type="x86 archive import"
;;
*ar\ archive*) # could be an import, or static
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
$EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
win32_nmres=`eval $NM -f posix -A $1 |
$SED -n -e '
1,100{
/ I /{
s,.*,import,
p
q
}
}'`
case $win32_nmres in
import*) win32_libid_type="x86 archive import";;
*) win32_libid_type="x86 archive static";;
esac
fi
;;
*DLL*)
win32_libid_type="x86 DLL"
;;
*executable*) # but shell scripts are "executable" too...
case $win32_fileres in
*MS\ Windows\ PE\ Intel*)
win32_libid_type="x86 DLL"
;;
esac
;;
esac
$ECHO "$win32_libid_type"
}
# func_extract_an_archive dir oldlib
func_extract_an_archive ()
{
$opt_debug
f_ex_an_ar_dir="$1"; shift
f_ex_an_ar_oldlib="$1"
func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
:
else
func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
fi
}
# func_extract_archives gentop oldlib ...
func_extract_archives ()
{
$opt_debug
my_gentop="$1"; shift
my_oldlibs=${1+"$@"}
my_oldobjs=""
my_xlib=""
my_xabs=""
my_xdir=""
for my_xlib in $my_oldlibs; do
# Extract the objects.
case $my_xlib in
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
func_basename "$my_xlib"
my_xlib="$func_basename_result"
my_xlib_u=$my_xlib
while :; do
case " $extracted_archives " in
*" $my_xlib_u "*)
func_arith $extracted_serial + 1
extracted_serial=$func_arith_result
my_xlib_u=lt$extracted_serial-$my_xlib ;;
*) break ;;
esac
done
extracted_archives="$extracted_archives $my_xlib_u"
my_xdir="$my_gentop/$my_xlib_u"
func_mkdir_p "$my_xdir"
case $host in
*-darwin*)
func_verbose "Extracting $my_xabs"
# Do not bother doing anything if just a dry run
$opt_dry_run || {
darwin_orig_dir=`pwd`
cd $my_xdir || exit $?
darwin_archive=$my_xabs
darwin_curdir=`pwd`
darwin_base_archive=`basename "$darwin_archive"`
darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
if test -n "$darwin_arches"; then
darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
darwin_arch=
func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
for darwin_arch in $darwin_arches ; do
func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
$LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
func_extract_an_archive "`pwd`" "${darwin_base_archive}"
cd "$darwin_curdir"
$RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
done # $darwin_arches
## Okay now we've a bunch of thin objects, gotta fatten them up :)
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
$LIPO -create -output "$darwin_file" $darwin_files
done # $darwin_filelist
$RM -rf unfat-$$
cd "$darwin_orig_dir"
else
cd $darwin_orig_dir
func_extract_an_archive "$my_xdir" "$my_xabs"
fi # $darwin_arches
} # !$opt_dry_run
;;
*)
func_extract_an_archive "$my_xdir" "$my_xabs"
;;
esac
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
func_extract_archives_result="$my_oldobjs"
}
# func_emit_wrapper_part1 [arg=no]
#
# Emit the first part of a libtool wrapper script on stdout.
# For more information, see the description associated with
# func_emit_wrapper(), below.
func_emit_wrapper_part1 ()
{
func_emit_wrapper_part1_arg1=no
if test -n "$1" ; then
func_emit_wrapper_part1_arg1=$1
fi
$ECHO "\
#! $SHELL
# $output - temporary wrapper script for $objdir/$outputname
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
#
# The $output program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed='${SED} -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
# Be Bourne compatible
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
relink_command=\"$relink_command\"
# This environment variable determines our operation mode.
if test \"\$libtool_install_magic\" = \"$magic\"; then
# install mode needs the following variables:
generated_by_libtool_version='$macro_version'
notinst_deplibs='$notinst_deplibs'
else
# When we are sourced in execute mode, \$file and \$ECHO are already set.
if test \"\$libtool_execute_magic\" != \"$magic\"; then
ECHO=\"$qecho\"
file=\"\$0\"
# Make sure echo works.
if test \"X\$1\" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
# Yippee, \$ECHO works!
:
else
# Restart under the correct shell, and then maybe \$ECHO will work.
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
fi
fi\
"
$ECHO "\
# Find the directory that this script lives in.
thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
while test -n \"\$file\"; do
destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
# If there was a directory component, then change thisdir.
if test \"x\$destdir\" != \"x\$file\"; then
case \"\$destdir\" in
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
*) thisdir=\"\$thisdir/\$destdir\" ;;
esac
fi
file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
done
"
}
# end: func_emit_wrapper_part1
# func_emit_wrapper_part2 [arg=no]
#
# Emit the second part of a libtool wrapper script on stdout.
# For more information, see the description associated with
# func_emit_wrapper(), below.
func_emit_wrapper_part2 ()
{
func_emit_wrapper_part2_arg1=no
if test -n "$1" ; then
func_emit_wrapper_part2_arg1=$1
fi
$ECHO "\
# Usually 'no', except on cygwin/mingw when embedded into
# the cwrapper.
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
# special case for '.'
if test \"\$thisdir\" = \".\"; then
thisdir=\`pwd\`
fi
# remove .libs from thisdir
case \"\$thisdir\" in
*[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
$objdir ) thisdir=. ;;
esac
fi
# Try to get the absolute directory name.
absdir=\`cd \"\$thisdir\" && pwd\`
test -n \"\$absdir\" && thisdir=\"\$absdir\"
"
if test "$fast_install" = yes; then
$ECHO "\
program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" ||
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
file=\"\$\$-\$program\"
if test ! -d \"\$progdir\"; then
$MKDIR \"\$progdir\"
else
$RM \"\$progdir/\$file\"
fi"
$ECHO "\
# relink executable if necessary
if test -n \"\$relink_command\"; then
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
else
$ECHO \"\$relink_command_output\" >&2
$RM \"\$progdir/\$file\"
exit 1
fi
fi
$MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
{ $RM \"\$progdir/\$program\";
$MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
$RM \"\$progdir/\$file\"
fi"
else
$ECHO "\
program='$outputname'
progdir=\"\$thisdir/$objdir\"
"
fi
$ECHO "\
if test -f \"\$progdir/\$program\"; then"
# Export our shlibpath_var if we have one.
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$ECHO "\
# Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
# Some systems cannot cope with colon-terminated $shlibpath_var
# The second colon is a workaround for a bug in BeOS R4 sed
$shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
export $shlibpath_var
"
fi
# fixup the dll searchpath if we need to.
if test -n "$dllsearchpath"; then
$ECHO "\
# Add the dll search path components to the executable PATH
PATH=$dllsearchpath:\$PATH
"
fi
$ECHO "\
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
"
case $host in
# Backslashes separate directories on plain windows
*-*-mingw | *-*-os2* | *-cegcc*)
$ECHO "\
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
"
;;
*)
$ECHO "\
exec \"\$progdir/\$program\" \${1+\"\$@\"}
"
;;
esac
$ECHO "\
\$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
exit 1
fi
else
# The program doesn't exist.
\$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
\$ECHO \"This script is just a wrapper for \$program.\" 1>&2
$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1
fi
fi\
"
}
# end: func_emit_wrapper_part2
# func_emit_wrapper [arg=no]
#
# Emit a libtool wrapper script on stdout.
# Don't directly open a file because we may want to
# incorporate the script contents within a cygwin/mingw
# wrapper executable. Must ONLY be called from within
# func_mode_link because it depends on a number of variables
# set therein.
#
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
# variable will take. If 'yes', then the emitted script
# will assume that the directory in which it is stored is
# the $objdir directory. This is a cygwin/mingw-specific
# behavior.
func_emit_wrapper ()
{
func_emit_wrapper_arg1=no
if test -n "$1" ; then
func_emit_wrapper_arg1=$1
fi
# split this up so that func_emit_cwrapperexe_src
# can call each part independently.
func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
}
# func_to_host_path arg
#
# Convert paths to host format when used with build tools.
# Intended for use with "native" mingw (where libtool itself
# is running under the msys shell), or in the following cross-
# build environments:
# $build $host
# mingw (msys) mingw [e.g. native]
# cygwin mingw
# *nix + wine mingw
# where wine is equipped with the `winepath' executable.
# In the native mingw case, the (msys) shell automatically
# converts paths for any non-msys applications it launches,
# but that facility isn't available from inside the cwrapper.
# Similar accommodations are necessary for $host mingw and
# $build cygwin. Calling this function does no harm for other
# $host/$build combinations not listed above.
#
# ARG is the path (on $build) that should be converted to
# the proper representation for $host. The result is stored
# in $func_to_host_path_result.
func_to_host_path ()
{
func_to_host_path_result="$1"
if test -n "$1" ; then
case $host in
*mingw* )
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
case $build in
*mingw* ) # actually, msys
# awkward: cmd appends spaces to result
lt_sed_strip_trailing_spaces="s/[ ]*\$//"
func_to_host_path_tmp1=`( cmd //c echo "$1" |\
$SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
$SED -e "$lt_sed_naive_backslashify"`
;;
*cygwin* )
func_to_host_path_tmp1=`cygpath -w "$1"`
func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
$SED -e "$lt_sed_naive_backslashify"`
;;
* )
# Unfortunately, winepath does not exit with a non-zero
# error code, so we are forced to check the contents of
# stdout. On the other hand, if the command is not
# found, the shell will set an exit code of 127 and print
# *an error message* to stdout. So we must check for both
# error code of zero AND non-empty stdout, which explains
# the odd construction:
func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
$SED -e "$lt_sed_naive_backslashify"`
else
# Allow warning below.
func_to_host_path_result=""
fi
;;
esac
if test -z "$func_to_host_path_result" ; then
func_error "Could not determine host path corresponding to"
func_error " '$1'"
func_error "Continuing, but uninstalled executables may not work."
# Fallback:
func_to_host_path_result="$1"
fi
;;
esac
fi
}
# end: func_to_host_path
# func_to_host_pathlist arg
#
# Convert pathlists to host format when used with build tools.
# See func_to_host_path(), above. This function supports the
# following $build/$host combinations (but does no harm for
# combinations not listed here):
# $build $host
# mingw (msys) mingw [e.g. native]
# cygwin mingw
# *nix + wine mingw
#
# Path separators are also converted from $build format to
# $host format. If ARG begins or ends with a path separator
# character, it is preserved (but converted to $host format)
# on output.
#
# ARG is a pathlist (on $build) that should be converted to
# the proper representation on $host. The result is stored
# in $func_to_host_pathlist_result.
func_to_host_pathlist ()
{
func_to_host_pathlist_result="$1"
if test -n "$1" ; then
case $host in
*mingw* )
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
# Remove leading and trailing path separator characters from
# ARG. msys behavior is inconsistent here, cygpath turns them
# into '.;' and ';.', and winepath ignores them completely.
func_to_host_pathlist_tmp2="$1"
# Once set for this call, this variable should not be
# reassigned. It is used in tha fallback case.
func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
$SED -e 's|^:*||' -e 's|:*$||'`
case $build in
*mingw* ) # Actually, msys.
# Awkward: cmd appends spaces to result.
lt_sed_strip_trailing_spaces="s/[ ]*\$//"
func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
$SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
$SED -e "$lt_sed_naive_backslashify"`
;;
*cygwin* )
func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
$SED -e "$lt_sed_naive_backslashify"`
;;
* )
# unfortunately, winepath doesn't convert pathlists
func_to_host_pathlist_result=""
func_to_host_pathlist_oldIFS=$IFS
IFS=:
for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
IFS=$func_to_host_pathlist_oldIFS
if test -n "$func_to_host_pathlist_f" ; then
func_to_host_path "$func_to_host_pathlist_f"
if test -n "$func_to_host_path_result" ; then
if test -z "$func_to_host_pathlist_result" ; then
func_to_host_pathlist_result="$func_to_host_path_result"
else
func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
fi
fi
fi
IFS=:
done
IFS=$func_to_host_pathlist_oldIFS
;;
esac
if test -z "$func_to_host_pathlist_result" ; then
func_error "Could not determine the host path(s) corresponding to"
func_error " '$1'"
func_error "Continuing, but uninstalled executables may not work."
# Fallback. This may break if $1 contains DOS-style drive
# specifications. The fix is not to complicate the expression
# below, but for the user to provide a working wine installation
# with winepath so that path translation in the cross-to-mingw
# case works properly.
lt_replace_pathsep_nix_to_dos="s|:|;|g"
func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
$SED -e "$lt_replace_pathsep_nix_to_dos"`
fi
# Now, add the leading and trailing path separators back
case "$1" in
:* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
;;
esac
case "$1" in
*: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
;;
esac
;;
esac
fi
}
# end: func_to_host_pathlist
# func_emit_cwrapperexe_src
# emit the source code for a wrapper executable on stdout
# Must ONLY be called from within func_mode_link because
# it depends on a number of variable set therein.
func_emit_cwrapperexe_src ()
{
cat <
#include
#ifdef _MSC_VER
# include
# include
# include
# define setmode _setmode
#else
# include
# include
# ifdef __CYGWIN__
# include
# define HAVE_SETENV
# ifdef __STRICT_ANSI__
char *realpath (const char *, char *);
int putenv (char *);
int setenv (const char *, const char *, int);
# endif
# endif
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#if defined(PATH_MAX)
# define LT_PATHMAX PATH_MAX
#elif defined(MAXPATHLEN)
# define LT_PATHMAX MAXPATHLEN
#else
# define LT_PATHMAX 1024
#endif
#ifndef S_IXOTH
# define S_IXOTH 0
#endif
#ifndef S_IXGRP
# define S_IXGRP 0
#endif
#ifdef _MSC_VER
# define S_IXUSR _S_IEXEC
# define stat _stat
# ifndef _INTPTR_T_DEFINED
# define intptr_t int
# endif
#endif
#ifndef DIR_SEPARATOR
# define DIR_SEPARATOR '/'
# define PATH_SEPARATOR ':'
#endif
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
defined (__OS2__)
# define HAVE_DOS_BASED_FILE_SYSTEM
# define FOPEN_WB "wb"
# ifndef DIR_SEPARATOR_2
# define DIR_SEPARATOR_2 '\\'
# endif
# ifndef PATH_SEPARATOR_2
# define PATH_SEPARATOR_2 ';'
# endif
#endif
#ifndef DIR_SEPARATOR_2
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
#else /* DIR_SEPARATOR_2 */
# define IS_DIR_SEPARATOR(ch) \
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
#endif /* DIR_SEPARATOR_2 */
#ifndef PATH_SEPARATOR_2
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
#else /* PATH_SEPARATOR_2 */
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
#endif /* PATH_SEPARATOR_2 */
#ifdef __CYGWIN__
# define FOPEN_WB "wb"
#endif
#ifndef FOPEN_WB
# define FOPEN_WB "w"
#endif
#ifndef _O_BINARY
# define _O_BINARY 0
#endif
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
#define XFREE(stale) do { \
if (stale) { free ((void *) stale); stale = 0; } \
} while (0)
#undef LTWRAPPER_DEBUGPRINTF
#if defined DEBUGWRAPPER
# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
static void
ltwrapper_debugprintf (const char *fmt, ...)
{
va_list args;
va_start (args, fmt);
(void) vfprintf (stderr, fmt, args);
va_end (args);
}
#else
# define LTWRAPPER_DEBUGPRINTF(args)
#endif
const char *program_name = NULL;
void *xmalloc (size_t num);
char *xstrdup (const char *string);
const char *base_name (const char *name);
char *find_executable (const char *wrapper);
char *chase_symlinks (const char *pathspec);
int make_executable (const char *path);
int check_executable (const char *path);
char *strendzap (char *str, const char *pat);
void lt_fatal (const char *message, ...);
void lt_setenv (const char *name, const char *value);
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
void lt_opt_process_env_set (const char *arg);
void lt_opt_process_env_prepend (const char *arg);
void lt_opt_process_env_append (const char *arg);
int lt_split_name_value (const char *arg, char** name, char** value);
void lt_update_exe_path (const char *name, const char *value);
void lt_update_lib_path (const char *name, const char *value);
static const char *script_text_part1 =
EOF
func_emit_wrapper_part1 yes |
$SED -e 's/\([\\"]\)/\\\1/g' \
-e 's/^/ "/' -e 's/$/\\n"/'
echo ";"
cat <")));
for (i = 0; i < newargc; i++)
{
LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "")));
}
EOF
case $host_os in
mingw*)
cat <<"EOF"
/* execv doesn't actually work on mingw as expected on unix */
rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
if (rval == -1)
{
/* failed to start process */
LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
return 127;
}
return rval;
EOF
;;
*)
cat <<"EOF"
execv (lt_argv_zero, newargz);
return rval; /* =127, but avoids unused variable warning */
EOF
;;
esac
cat <<"EOF"
}
void *
xmalloc (size_t num)
{
void *p = (void *) malloc (num);
if (!p)
lt_fatal ("Memory exhausted");
return p;
}
char *
xstrdup (const char *string)
{
return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
string) : NULL;
}
const char *
base_name (const char *name)
{
const char *base;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* Skip over the disk name in MSDOS pathnames. */
if (isalpha ((unsigned char) name[0]) && name[1] == ':')
name += 2;
#endif
for (base = name; *name; name++)
if (IS_DIR_SEPARATOR (*name))
base = name + 1;
return base;
}
int
check_executable (const char *path)
{
struct stat st;
LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
path ? (*path ? path : "EMPTY!") : "NULL!"));
if ((!path) || (!*path))
return 0;
if ((stat (path, &st) >= 0)
&& (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
return 1;
else
return 0;
}
int
make_executable (const char *path)
{
int rval = 0;
struct stat st;
LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
path ? (*path ? path : "EMPTY!") : "NULL!"));
if ((!path) || (!*path))
return 0;
if (stat (path, &st) >= 0)
{
rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
}
return rval;
}
/* Searches for the full path of the wrapper. Returns
newly allocated full path name if found, NULL otherwise
Does not chase symlinks, even on platforms that support them.
*/
char *
find_executable (const char *wrapper)
{
int has_slash = 0;
const char *p;
const char *p_next;
/* static buffer for getcwd */
char tmp[LT_PATHMAX + 1];
int tmp_len;
char *concat_name;
LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
if ((wrapper == NULL) || (*wrapper == '\0'))
return NULL;
/* Absolute path? */
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
{
concat_name = xstrdup (wrapper);
if (check_executable (concat_name))
return concat_name;
XFREE (concat_name);
}
else
{
#endif
if (IS_DIR_SEPARATOR (wrapper[0]))
{
concat_name = xstrdup (wrapper);
if (check_executable (concat_name))
return concat_name;
XFREE (concat_name);
}
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
}
#endif
for (p = wrapper; *p; p++)
if (*p == '/')
{
has_slash = 1;
break;
}
if (!has_slash)
{
/* no slashes; search PATH */
const char *path = getenv ("PATH");
if (path != NULL)
{
for (p = path; *p; p = p_next)
{
const char *q;
size_t p_len;
for (q = p; *q; q++)
if (IS_PATH_SEPARATOR (*q))
break;
p_len = q - p;
p_next = (*q == '\0' ? q : q + 1);
if (p_len == 0)
{
/* empty path: current directory */
if (getcwd (tmp, LT_PATHMAX) == NULL)
lt_fatal ("getcwd failed");
tmp_len = strlen (tmp);
concat_name =
XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
concat_name[tmp_len] = '/';
strcpy (concat_name + tmp_len + 1, wrapper);
}
else
{
concat_name =
XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
memcpy (concat_name, p, p_len);
concat_name[p_len] = '/';
strcpy (concat_name + p_len + 1, wrapper);
}
if (check_executable (concat_name))
return concat_name;
XFREE (concat_name);
}
}
/* not found in PATH; assume curdir */
}
/* Relative path | not found in path: prepend cwd */
if (getcwd (tmp, LT_PATHMAX) == NULL)
lt_fatal ("getcwd failed");
tmp_len = strlen (tmp);
concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
memcpy (concat_name, tmp, tmp_len);
concat_name[tmp_len] = '/';
strcpy (concat_name + tmp_len + 1, wrapper);
if (check_executable (concat_name))
return concat_name;
XFREE (concat_name);
return NULL;
}
char *
chase_symlinks (const char *pathspec)
{
#ifndef S_ISLNK
return xstrdup (pathspec);
#else
char buf[LT_PATHMAX];
struct stat s;
char *tmp_pathspec = xstrdup (pathspec);
char *p;
int has_symlinks = 0;
while (strlen (tmp_pathspec) && !has_symlinks)
{
LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
tmp_pathspec));
if (lstat (tmp_pathspec, &s) == 0)
{
if (S_ISLNK (s.st_mode) != 0)
{
has_symlinks = 1;
break;
}
/* search backwards for last DIR_SEPARATOR */
p = tmp_pathspec + strlen (tmp_pathspec) - 1;
while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
p--;
if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
{
/* no more DIR_SEPARATORS left */
break;
}
*p = '\0';
}
else
{
char *errstr = strerror (errno);
lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
}
}
XFREE (tmp_pathspec);
if (!has_symlinks)
{
return xstrdup (pathspec);
}
tmp_pathspec = realpath (pathspec, buf);
if (tmp_pathspec == 0)
{
lt_fatal ("Could not follow symlinks for %s", pathspec);
}
return xstrdup (tmp_pathspec);
#endif
}
char *
strendzap (char *str, const char *pat)
{
size_t len, patlen;
assert (str != NULL);
assert (pat != NULL);
len = strlen (str);
patlen = strlen (pat);
if (patlen <= len)
{
str += len - patlen;
if (strcmp (str, pat) == 0)
*str = '\0';
}
return str;
}
static void
lt_error_core (int exit_status, const char *mode,
const char *message, va_list ap)
{
fprintf (stderr, "%s: %s: ", program_name, mode);
vfprintf (stderr, message, ap);
fprintf (stderr, ".\n");
if (exit_status >= 0)
exit (exit_status);
}
void
lt_fatal (const char *message, ...)
{
va_list ap;
va_start (ap, message);
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
va_end (ap);
}
void
lt_setenv (const char *name, const char *value)
{
LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
(name ? name : ""),
(value ? value : "")));
{
#ifdef HAVE_SETENV
/* always make a copy, for consistency with !HAVE_SETENV */
char *str = xstrdup (value);
setenv (name, str, 1);
#else
int len = strlen (name) + 1 + strlen (value) + 1;
char *str = XMALLOC (char, len);
sprintf (str, "%s=%s", name, value);
if (putenv (str) != EXIT_SUCCESS)
{
XFREE (str);
}
#endif
}
}
char *
lt_extend_str (const char *orig_value, const char *add, int to_end)
{
char *new_value;
if (orig_value && *orig_value)
{
int orig_value_len = strlen (orig_value);
int add_len = strlen (add);
new_value = XMALLOC (char, add_len + orig_value_len + 1);
if (to_end)
{
strcpy (new_value, orig_value);
strcpy (new_value + orig_value_len, add);
}
else
{
strcpy (new_value, add);
strcpy (new_value + add_len, orig_value);
}
}
else
{
new_value = xstrdup (add);
}
return new_value;
}
int
lt_split_name_value (const char *arg, char** name, char** value)
{
const char *p;
int len;
if (!arg || !*arg)
return 1;
p = strchr (arg, (int)'=');
if (!p)
return 1;
*value = xstrdup (++p);
len = strlen (arg) - strlen (*value);
*name = XMALLOC (char, len);
strncpy (*name, arg, len-1);
(*name)[len - 1] = '\0';
return 0;
}
void
lt_opt_process_env_set (const char *arg)
{
char *name = NULL;
char *value = NULL;
if (lt_split_name_value (arg, &name, &value) != 0)
{
XFREE (name);
XFREE (value);
lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
}
lt_setenv (name, value);
XFREE (name);
XFREE (value);
}
void
lt_opt_process_env_prepend (const char *arg)
{
char *name = NULL;
char *value = NULL;
char *new_value = NULL;
if (lt_split_name_value (arg, &name, &value) != 0)
{
XFREE (name);
XFREE (value);
lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
}
new_value = lt_extend_str (getenv (name), value, 0);
lt_setenv (name, new_value);
XFREE (new_value);
XFREE (name);
XFREE (value);
}
void
lt_opt_process_env_append (const char *arg)
{
char *name = NULL;
char *value = NULL;
char *new_value = NULL;
if (lt_split_name_value (arg, &name, &value) != 0)
{
XFREE (name);
XFREE (value);
lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
}
new_value = lt_extend_str (getenv (name), value, 1);
lt_setenv (name, new_value);
XFREE (new_value);
XFREE (name);
XFREE (value);
}
void
lt_update_exe_path (const char *name, const char *value)
{
LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
(name ? name : ""),
(value ? value : "")));
if (name && *name && value && *value)
{
char *new_value = lt_extend_str (getenv (name), value, 0);
/* some systems can't cope with a ':'-terminated path #' */
int len = strlen (new_value);
while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
{
new_value[len-1] = '\0';
}
lt_setenv (name, new_value);
XFREE (new_value);
}
}
void
lt_update_lib_path (const char *name, const char *value)
{
LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
(name ? name : ""),
(value ? value : "")));
if (name && *name && value && *value)
{
char *new_value = lt_extend_str (getenv (name), value, 0);
lt_setenv (name, new_value);
XFREE (new_value);
}
}
EOF
}
# end: func_emit_cwrapperexe_src
# func_mode_link arg...
func_mode_link ()
{
$opt_debug
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# which system we are compiling for in order to pass an extra
# flag for every libtool invocation.
# allow_undefined=no
# FIXME: Unfortunately, there are problems with the above when trying
# to make a dll which has undefined symbols, in which case not
# even a static library is built. For now, we need to specify
# -no-undefined on the libtool link line when we can be certain
# that all symbols are satisfied, otherwise we get a static library.
allow_undefined=yes
;;
*)
allow_undefined=yes
;;
esac
libtool_args=$nonopt
base_compile="$nonopt $@"
compile_command=$nonopt
finalize_command=$nonopt
compile_rpath=
finalize_rpath=
compile_shlibpath=
finalize_shlibpath=
convenience=
old_convenience=
deplibs=
old_deplibs=
compiler_flags=
linker_flags=
dllsearchpath=
lib_search_path=`pwd`
inst_prefix_dir=
new_inherited_linker_flags=
avoid_version=no
dlfiles=
dlprefiles=
dlself=no
export_dynamic=no
export_symbols=
export_symbols_regex=
generated=
libobjs=
ltlibs=
module=no
no_install=no
objs=
non_pic_objects=
precious_files_regex=
prefer_static_libs=no
preload=no
prev=
prevarg=
release=
rpath=
xrpath=
perm_rpath=
temp_rpath=
thread_safe=no
vinfo=
vinfo_number=no
weak_libs=
single_module="${wl}-single_module"
func_infer_tag $base_compile
# We need to know -static, to get the right output filenames.
for arg
do
case $arg in
-shared)
test "$build_libtool_libs" != yes && \
func_fatal_configuration "can not build a shared library"
build_old_libs=no
break
;;
-all-static | -static | -static-libtool-libs)
case $arg in
-all-static)
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
func_warning "complete static linking is impossible in this configuration"
fi
if test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
;;
-static)
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=built
;;
-static-libtool-libs)
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
;;
esac
build_libtool_libs=no
build_old_libs=yes
break
;;
esac
done
# See if our shared archives depend on static archives.
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
# Go through the arguments, transforming them on the way.
while test "$#" -gt 0; do
arg="$1"
shift
func_quote_for_eval "$arg"
qarg=$func_quote_for_eval_unquoted_result
func_append libtool_args " $func_quote_for_eval_result"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
output)
func_append compile_command " @OUTPUT@"
func_append finalize_command " @OUTPUT@"
;;
esac
case $prev in
dlfiles|dlprefiles)
if test "$preload" = no; then
# Add the symbol object into the linking commands.
func_append compile_command " @SYMFILE@"
func_append finalize_command " @SYMFILE@"
preload=yes
fi
case $arg in
*.la | *.lo) ;; # We handle these cases below.
force)
if test "$dlself" = no; then
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
self)
if test "$prev" = dlprefiles; then
dlself=yes
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
dlself=yes
else
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
*)
if test "$prev" = dlfiles; then
dlfiles="$dlfiles $arg"
else
dlprefiles="$dlprefiles $arg"
fi
prev=
continue
;;
esac
;;
expsyms)
export_symbols="$arg"
test -f "$arg" \
|| func_fatal_error "symbol file \`$arg' does not exist"
prev=
continue
;;
expsyms_regex)
export_symbols_regex="$arg"
prev=
continue
;;
framework)
case $host in
*-*-darwin*)
case "$deplibs " in
*" $qarg.ltframework "*) ;;
*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
;;
esac
;;
esac
prev=
continue
;;
inst_prefix)
inst_prefix_dir="$arg"
prev=
continue
;;
objectlist)
if test -f "$arg"; then
save_arg=$arg
moreargs=
for fil in `cat "$save_arg"`
do
# moreargs="$moreargs $fil"
arg=$fil
# A libtool-controlled object.
# Check to see that this really is a libtool object.
if func_lalib_unsafe_p "$arg"; then
pic_object=
non_pic_object=
# Read the .lo file
func_source "$arg"
if test -z "$pic_object" ||
test -z "$non_pic_object" ||
test "$pic_object" = none &&
test "$non_pic_object" = none; then
func_fatal_error "cannot find name of object for \`$arg'"
fi
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
xdir="$func_dirname_result"
if test "$pic_object" != none; then
# Prepend the subdirectory the object is found in.
pic_object="$xdir$pic_object"
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
dlfiles="$dlfiles $pic_object"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
dlprefiles="$dlprefiles $pic_object"
prev=
fi
# A PIC object.
func_append libobjs " $pic_object"
arg="$pic_object"
fi
# Non-PIC object.
if test "$non_pic_object" != none; then
# Prepend the subdirectory the object is found in.
non_pic_object="$xdir$non_pic_object"
# A standard non-PIC object
func_append non_pic_objects " $non_pic_object"
if test -z "$pic_object" || test "$pic_object" = none ; then
arg="$non_pic_object"
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
non_pic_object="$pic_object"
func_append non_pic_objects " $non_pic_object"
fi
else
# Only an error if not doing a dry-run.
if $opt_dry_run; then
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
xdir="$func_dirname_result"
func_lo2o "$arg"
pic_object=$xdir$objdir/$func_lo2o_result
non_pic_object=$xdir$func_lo2o_result
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
func_fatal_error "\`$arg' is not a valid libtool object"
fi
fi
done
else
func_fatal_error "link input file \`$arg' does not exist"
fi
arg=$save_arg
prev=
continue
;;
precious_regex)
precious_files_regex="$arg"
prev=
continue
;;
release)
release="-$arg"
prev=
continue
;;
rpath | xrpath)
# We need an absolute path.
case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
func_fatal_error "only absolute run-paths are allowed"
;;
esac
if test "$prev" = rpath; then
case "$rpath " in
*" $arg "*) ;;
*) rpath="$rpath $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
*) xrpath="$xrpath $arg" ;;
esac
fi
prev=
continue
;;
shrext)
shrext_cmds="$arg"
prev=
continue
;;
weak)
weak_libs="$weak_libs $arg"
prev=
continue
;;
xcclinker)
linker_flags="$linker_flags $qarg"
compiler_flags="$compiler_flags $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xcompiler)
compiler_flags="$compiler_flags $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xlinker)
linker_flags="$linker_flags $qarg"
compiler_flags="$compiler_flags $wl$qarg"
prev=
func_append compile_command " $wl$qarg"
func_append finalize_command " $wl$qarg"
continue
;;
*)
eval "$prev=\"\$arg\""
prev=
continue
;;
esac
fi # test -n "$prev"
prevarg="$arg"
case $arg in
-all-static)
if test -n "$link_static_flag"; then
# See comment for -static flag below, for more details.
func_append compile_command " $link_static_flag"
func_append finalize_command " $link_static_flag"
fi
continue
;;
-allow-undefined)
# FIXME: remove this flag sometime in the future.
func_fatal_error "\`-allow-undefined' must not be used because it is the default"
;;
-avoid-version)
avoid_version=yes
continue
;;
-dlopen)
prev=dlfiles
continue
;;
-dlpreopen)
prev=dlprefiles
continue
;;
-export-dynamic)
export_dynamic=yes
continue
;;
-export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
func_fatal_error "more than one -exported-symbols argument is not allowed"
fi
if test "X$arg" = "X-export-symbols"; then
prev=expsyms
else
prev=expsyms_regex
fi
continue
;;
-framework)
prev=framework
continue
;;
-inst-prefix-dir)
prev=inst_prefix
continue
;;
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
# so, if we see these flags be careful not to treat them like -L
-L[A-Z][A-Z]*:*)
case $with_gcc/$host in
no/*-*-irix* | /*-*-irix*)
func_append compile_command " $arg"
func_append finalize_command " $arg"
;;
esac
continue
;;
-L*)
func_stripname '-L' '' "$arg"
dir=$func_stripname_result
if test -z "$dir"; then
if test "$#" -gt 0; then
func_fatal_error "require no space between \`-L' and \`$1'"
else
func_fatal_error "need path for \`-L' option"
fi
fi
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
absdir=`cd "$dir" && pwd`
test -z "$absdir" && \
func_fatal_error "cannot determine absolute directory name of \`$dir'"
dir="$absdir"
;;
esac
case "$deplibs " in
*" -L$dir "*) ;;
*)
deplibs="$deplibs -L$dir"
lib_search_path="$lib_search_path $dir"
;;
esac
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$dir:"*) ;;
::) dllsearchpath=$dir;;
*) dllsearchpath="$dllsearchpath:$dir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
*) dllsearchpath="$dllsearchpath:$testbindir";;
esac
;;
esac
continue
;;
-l*)
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
# These systems don't actually have a C or math library (as such)
continue
;;
*-*-os2*)
# These systems don't actually have a C library (as such)
test "X$arg" = "X-lc" && continue
;;
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
# Do not include libc due to us having libc/libc_r.
test "X$arg" = "X-lc" && continue
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
deplibs="$deplibs System.ltframework"
continue
;;
*-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype
test "X$arg" = "X-lc" && continue
;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work
test "X$arg" = "X-lc" && continue
;;
esac
elif test "X$arg" = "X-lc_r"; then
case $host in
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
esac
fi
deplibs="$deplibs $arg"
continue
;;
-module)
module=yes
continue
;;
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
-model|-arch|-isysroot)
compiler_flags="$compiler_flags $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
prev=xcompiler
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
compiler_flags="$compiler_flags $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
case "$new_inherited_linker_flags " in
*" $arg "*) ;;
* ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
esac
continue
;;
-multi_module)
single_module="${wl}-multi_module"
continue
;;
-no-fast-install)
fast_install=no
continue
;;
-no-install)
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
# The PATH hackery in wrapper scripts is required on Windows
# and Darwin in order for the loader to find any dlls it needs.
func_warning "\`-no-install' is ignored for $host"
func_warning "assuming \`-no-fast-install' instead"
fast_install=no
;;
*) no_install=yes ;;
esac
continue
;;
-no-undefined)
allow_undefined=no
continue
;;
-objectlist)
prev=objectlist
continue
;;
-o) prev=output ;;
-precious-files-regex)
prev=precious_regex
continue
;;
-release)
prev=release
continue
;;
-rpath)
prev=rpath
continue
;;
-R)
prev=xrpath
continue
;;
-R*)
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
func_fatal_error "only absolute run-paths are allowed"
;;
esac
case "$xrpath " in
*" $dir "*) ;;
*) xrpath="$xrpath $dir" ;;
esac
continue
;;
-shared)
# The effects of -shared are defined in a previous loop.
continue
;;
-shrext)
prev=shrext
continue
;;
-static | -static-libtool-libs)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
# would be equivalent was wrong. It would break on at least
# Digital Unix and AIX.
continue
;;
-thread-safe)
thread_safe=yes
continue
;;
-version-info)
prev=vinfo
continue
;;
-version-number)
prev=vinfo
vinfo_number=yes
continue
;;
-weak)
prev=weak
continue
;;
-Wc,*)
func_stripname '-Wc,' '' "$arg"
args=$func_stripname_result
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
func_quote_for_eval "$flag"
arg="$arg $wl$func_quote_for_eval_result"
compiler_flags="$compiler_flags $func_quote_for_eval_result"
done
IFS="$save_ifs"
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
-Wl,*)
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
func_quote_for_eval "$flag"
arg="$arg $wl$func_quote_for_eval_result"
compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
linker_flags="$linker_flags $func_quote_for_eval_result"
done
IFS="$save_ifs"
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
-Xcompiler)
prev=xcompiler
continue
;;
-Xlinker)
prev=xlinker
continue
;;
-XCClinker)
prev=xcclinker
continue
;;
# -msg_* for osf cc
-msg_*)
func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
;;
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler
# -r[0-9][0-9]* specifies the processor on the SGI compiler
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
# +DA*, +DD* enable 64-bit mode on the HP compiler
# -q* pass through compiler args for the IBM compiler
# -m*, -t[45]*, -txscale* pass through architecture-specific
# compiler args for GCC
# -F/path gives path to uninstalled frameworks, gcc on darwin
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
# @file GCC response files
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
func_append compile_command " $arg"
func_append finalize_command " $arg"
compiler_flags="$compiler_flags $arg"
continue
;;
# Some other compiler flag.
-* | +*)
func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
;;
*.$objext)
# A standard object.
objs="$objs $arg"
;;
*.lo)
# A libtool-controlled object.
# Check to see that this really is a libtool object.
if func_lalib_unsafe_p "$arg"; then
pic_object=
non_pic_object=
# Read the .lo file
func_source "$arg"
if test -z "$pic_object" ||
test -z "$non_pic_object" ||
test "$pic_object" = none &&
test "$non_pic_object" = none; then
func_fatal_error "cannot find name of object for \`$arg'"
fi
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
xdir="$func_dirname_result"
if test "$pic_object" != none; then
# Prepend the subdirectory the object is found in.
pic_object="$xdir$pic_object"
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
dlfiles="$dlfiles $pic_object"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
dlprefiles="$dlprefiles $pic_object"
prev=
fi
# A PIC object.
func_append libobjs " $pic_object"
arg="$pic_object"
fi
# Non-PIC object.
if test "$non_pic_object" != none; then
# Prepend the subdirectory the object is found in.
non_pic_object="$xdir$non_pic_object"
# A standard non-PIC object
func_append non_pic_objects " $non_pic_object"
if test -z "$pic_object" || test "$pic_object" = none ; then
arg="$non_pic_object"
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
non_pic_object="$pic_object"
func_append non_pic_objects " $non_pic_object"
fi
else
# Only an error if not doing a dry-run.
if $opt_dry_run; then
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
xdir="$func_dirname_result"
func_lo2o "$arg"
pic_object=$xdir$objdir/$func_lo2o_result
non_pic_object=$xdir$func_lo2o_result
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
func_fatal_error "\`$arg' is not a valid libtool object"
fi
fi
;;
*.$libext)
# An archive.
deplibs="$deplibs $arg"
old_deplibs="$old_deplibs $arg"
continue
;;
*.la)
# A libtool-controlled library.
if test "$prev" = dlfiles; then
# This library was specified with -dlopen.
dlfiles="$dlfiles $arg"
prev=
elif test "$prev" = dlprefiles; then
# The library was specified with -dlpreopen.
dlprefiles="$dlprefiles $arg"
prev=
else
deplibs="$deplibs $arg"
fi
continue
;;
# Some other compiler argument.
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
;;
esac # arg
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
func_append compile_command " $arg"
func_append finalize_command " $arg"
fi
done # argument parsing loop
test -n "$prev" && \
func_fatal_help "the \`$prevarg' option requires an argument"
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
func_append compile_command " $arg"
func_append finalize_command " $arg"
fi
oldlibs=
# calculate the name of the file, without its directory
func_basename "$output"
outputname="$func_basename_result"
libobjs_save="$libobjs"
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
else
shlib_search_path=
fi
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
func_dirname "$output" "/" ""
output_objdir="$func_dirname_result$objdir"
# Create the object directory.
func_mkdir_p "$output_objdir"
# Determine the type of output
case $output in
"")
func_fatal_help "you must specify an output file"
;;
*.$libext) linkmode=oldlib ;;
*.lo | *.$objext) linkmode=obj ;;
*.la) linkmode=lib ;;
*) linkmode=prog ;; # Anything else should be a program.
esac
specialdeplibs=
libs=
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
if $opt_duplicate_deps ; then
case "$libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
libs="$libs $deplib"
done
if test "$linkmode" = lib; then
libs="$predeps $libs $compiler_lib_search_path $postdeps"
# Compute libraries that are listed more than once in $predeps
# $postdeps and mark them as special (i.e., whose duplicates are
# not to be eliminated).
pre_post_deps=
if $opt_duplicate_compiler_generated_deps; then
for pre_post_dep in $predeps $postdeps; do
case "$pre_post_deps " in
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
esac
pre_post_deps="$pre_post_deps $pre_post_dep"
done
fi
pre_post_deps=
fi
deplibs=
newdependency_libs=
newlib_search_path=
need_relink=no # whether we're linking any uninstalled libtool libraries
notinst_deplibs= # not-installed libtool libraries
notinst_path= # paths that contain not-installed libtool libraries
case $linkmode in
lib)
passes="conv dlpreopen link"
for file in $dlfiles $dlprefiles; do
case $file in
*.la) ;;
*)
func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
;;
esac
done
;;
prog)
compile_deplibs=
finalize_deplibs=
alldeplibs=no
newdlfiles=
newdlprefiles=
passes="conv scan dlopen dlpreopen link"
;;
*) passes="conv"
;;
esac
for pass in $passes; do
# The preopen pass in lib mode reverses $deplibs; put it back here
# so that -L comes before libs that need it for instance...
if test "$linkmode,$pass" = "lib,link"; then
## FIXME: Find the place where the list is rebuilt in the wrong
## order, and fix it there properly
tmp_deplibs=
for deplib in $deplibs; do
tmp_deplibs="$deplib $tmp_deplibs"
done
deplibs="$tmp_deplibs"
fi
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan"; then
libs="$deplibs"
deplibs=
fi
if test "$linkmode" = prog; then
case $pass in
dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
if test "$linkmode,$pass" = "lib,dlpreopen"; then
# Collect and forward deplibs of preopened libtool libs
for lib in $dlprefiles; do
# Ignore non-libtool-libs
dependency_libs=
case $lib in
*.la) func_source "$lib" ;;
esac
# Collect preopened libtool deplibs, except any this library
# has declared as weak libs
for deplib in $dependency_libs; do
deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
case " $weak_libs " in
*" $deplib_base "*) ;;
*) deplibs="$deplibs $deplib" ;;
esac
done
done
libs="$dlprefiles"
fi
if test "$pass" = dlopen; then
# Collect dlpreopened libraries
save_deplibs="$deplibs"
deplibs=
fi
for deplib in $libs; do
lib=
found=no
case $deplib in
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
compiler_flags="$compiler_flags $deplib"
if test "$linkmode" = lib ; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
* ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
esac
fi
fi
continue
;;
-l*)
if test "$linkmode" != lib && test "$linkmode" != prog; then
func_warning "\`-l' is ignored for archives/objects"
continue
fi
func_stripname '-l' '' "$deplib"
name=$func_stripname_result
if test "$linkmode" = lib; then
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
else
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
fi
for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
lib="$searchdir/lib${name}${search_ext}"
if test -f "$lib"; then
if test "$search_ext" = ".la"; then
found=yes
else
found=no
fi
break 2
fi
done
done
if test "$found" != yes; then
# deplib doesn't seem to be a libtool library
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
fi
continue
else # deplib is a libtool library
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
# We need to do some special things here, and not later.
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $deplib "*)
if func_lalib_p "$lib"; then
library_names=
old_library=
func_source "$lib"
for l in $old_library $library_names; do
ll="$l"
done
if test "X$ll" = "X$old_library" ; then # only static version available
found=no
func_dirname "$lib" "" "."
ladir="$func_dirname_result"
lib=$ladir/$old_library
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
fi
;;
*) ;;
esac
fi
fi
;; # -l
*.ltframework)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
if test "$linkmode" = lib ; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
* ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
esac
fi
fi
continue
;;
-L*)
case $linkmode in
lib)
deplibs="$deplib $deplibs"
test "$pass" = conv && continue
newdependency_libs="$deplib $newdependency_libs"
func_stripname '-L' '' "$deplib"
newlib_search_path="$newlib_search_path $func_stripname_result"
;;
prog)
if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
if test "$pass" = scan; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
func_stripname '-L' '' "$deplib"
newlib_search_path="$newlib_search_path $func_stripname_result"
;;
*)
func_warning "\`-L' is ignored for archives/objects"
;;
esac # linkmode
continue
;; # -L
-R*)
if test "$pass" = link; then
func_stripname '-R' '' "$deplib"
dir=$func_stripname_result
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
*" $dir "*) ;;
*) xrpath="$xrpath $dir" ;;
esac
fi
deplibs="$deplib $deplibs"
continue
;;
*.la) lib="$deplib" ;;
*.$libext)
if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
case $linkmode in
lib)
# Linking convenience modules into shared libraries is allowed,
# but linking other static libraries is non-portable.
case " $dlpreconveniencelibs " in
*" $deplib "*) ;;
*)
valid_a_lib=no
case $deplibs_check_method in
match_pattern*)
set dummy $deplibs_check_method; shift
match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
valid_a_lib=yes
fi
;;
pass_all)
valid_a_lib=yes
;;
esac
if test "$valid_a_lib" != yes; then
$ECHO
$ECHO "*** Warning: Trying to link with static lib archive $deplib."
$ECHO "*** I have the capability to make that library automatically link in when"
$ECHO "*** you link to this library. But I can only do this if you have a"
$ECHO "*** shared version of the library, which you do not appear to have"
$ECHO "*** because the file extensions .$libext of this argument makes me believe"
$ECHO "*** that it is just a static archive that I should not use here."
else
$ECHO
$ECHO "*** Warning: Linking the shared library $output against the"
$ECHO "*** static library $deplib is not portable!"
deplibs="$deplib $deplibs"
fi
;;
esac
continue
;;
prog)
if test "$pass" != link; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
continue
;;
esac # linkmode
;; # *.$libext
*.lo | *.$objext)
if test "$pass" = conv; then
deplibs="$deplib $deplibs"
elif test "$linkmode" = prog; then
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
newdlprefiles="$newdlprefiles $deplib"
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
newdlfiles="$newdlfiles $deplib"
fi
fi
continue
;;
%DEPLIBS%)
alldeplibs=yes
continue
;;
esac # case $deplib
if test "$found" = yes || test -f "$lib"; then :
else
func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
fi
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$lib" \
|| func_fatal_error "\`$lib' is not a valid libtool archive"
func_dirname "$lib" "" "."
ladir="$func_dirname_result"
dlname=
dlopen=
dlpreopen=
libdir=
library_names=
old_library=
inherited_linker_flags=
# If the library was installed with an old release of libtool,
# it will not redefine variables installed, or shouldnotlink
installed=yes
shouldnotlink=no
avoidtemprpath=
# Read the .la file
func_source "$lib"
# Convert "-framework foo" to "foo.ltframework"
if test -n "$inherited_linker_flags"; then
tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
*) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
esac
done
fi
dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
fi
if test "$pass" = conv; then
# Only check for convenience libraries
deplibs="$lib $deplibs"
if test -z "$libdir"; then
if test -z "$old_library"; then
func_fatal_error "cannot find name of link library for \`$lib'"
fi
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $ladir/$objdir/$old_library"
old_convenience="$old_convenience $ladir/$objdir/$old_library"
elif test "$linkmode" != prog && test "$linkmode" != lib; then
func_fatal_error "\`$lib' is not a convenience library"
fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if $opt_duplicate_deps ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
continue
fi # $pass = conv
# Get the name of the library we link against.
linklib=
for l in $old_library $library_names; do
linklib="$l"
done
if test -z "$linklib"; then
func_fatal_error "cannot find name of link library for \`$lib'"
fi
# This library was specified with -dlopen.
if test "$pass" = dlopen; then
if test -z "$libdir"; then
func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
fi
if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no; then
# If there is no dlname, no dlopen support or we're linking
# statically, we need to preload. We also need to preload any
# dependent libraries so libltdl's deplib preloader doesn't
# bomb out in the load deplibs phase.
dlprefiles="$dlprefiles $lib $dependency_libs"
else
newdlfiles="$newdlfiles $lib"
fi
continue
fi # $pass = dlopen
# We need an absolute path.
case $ladir in
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
func_warning "cannot determine absolute directory name of \`$ladir'"
func_warning "passing it literally to the linker, although it might fail"
abs_ladir="$ladir"
fi
;;
esac
func_basename "$lib"
laname="$func_basename_result"
# Find the relevant object directory and library name.
if test "X$installed" = Xyes; then
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
func_warning "library \`$lib' was moved."
dir="$ladir"
absdir="$abs_ladir"
libdir="$abs_ladir"
else
dir="$libdir"
absdir="$libdir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
dir="$ladir"
absdir="$abs_ladir"
# Remove this search path later
notinst_path="$notinst_path $abs_ladir"
else
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
notinst_path="$notinst_path $abs_ladir"
fi
fi # $installed = yes
func_stripname 'lib' '.la' "$laname"
name=$func_stripname_result
# This library was specified with -dlpreopen.
if test "$pass" = dlpreopen; then
if test -z "$libdir" && test "$linkmode" = prog; then
func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
fi
# Prefer using a static library (so that no silly _DYNAMIC symbols
# are required to link).
if test -n "$old_library"; then
newdlprefiles="$newdlprefiles $dir/$old_library"
# Keep a list of preopened convenience libraries to check
# that they are being used correctly in the link pass.
test -z "$libdir" && \
dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
# Otherwise, use the dlname, so that lt_dlopen finds it.
elif test -n "$dlname"; then
newdlprefiles="$newdlprefiles $dir/$dlname"
else
newdlprefiles="$newdlprefiles $dir/$linklib"
fi
fi # $pass = dlpreopen
if test -z "$libdir"; then
# Link the convenience library
if test "$linkmode" = lib; then
deplibs="$dir/$old_library $deplibs"
elif test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs"
else
deplibs="$lib $deplibs" # used for prog,scan pass
fi
continue
fi
if test "$linkmode" = prog && test "$pass" != link; then
newlib_search_path="$newlib_search_path $ladir"
deplibs="$lib $deplibs"
linkalldeplibs=no
if test "$link_all_deplibs" != no || test -z "$library_names" ||
test "$build_libtool_libs" = no; then
linkalldeplibs=yes
fi
tmp_libs=
for deplib in $dependency_libs; do
case $deplib in
-L*) func_stripname '-L' '' "$deplib"
newlib_search_path="$newlib_search_path $func_stripname_result"
;;
esac
# Need to link against all dependency_libs?
if test "$linkalldeplibs" = yes; then
deplibs="$deplib $deplibs"
else
# Need to hardcode shared library paths
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
if $opt_duplicate_deps ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done # for deplib
continue
fi # $linkmode = prog...
if test "$linkmode,$pass" = "prog,link"; then
if test -n "$library_names" &&
{ { test "$prefer_static_libs" = no ||
test "$prefer_static_libs,$installed" = "built,yes"; } ||
test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
# Make sure the rpath contains only unique directories.
case "$temp_rpath:" in
*"$absdir:"*) ;;
*) temp_rpath="$temp_rpath$absdir:" ;;
esac
fi
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) compile_rpath="$compile_rpath $absdir"
esac
;;
esac
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir"
esac
;;
esac
fi # $linkmode,$pass = prog,link...
if test "$alldeplibs" = yes &&
{ test "$deplibs_check_method" = pass_all ||
{ test "$build_libtool_libs" = yes &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
fi
fi
link_static=no # Whether the deplib will be linked statically
use_static_libs=$prefer_static_libs
if test "$use_static_libs" = built && test "$installed" = yes; then
use_static_libs=no
fi
if test -n "$library_names" &&
{ test "$use_static_libs" = no || test -z "$old_library"; }; then
case $host in
*cygwin* | *mingw* | *cegcc*)
# No point in relinking DLLs because paths are not encoded
notinst_deplibs="$notinst_deplibs $lib"
need_relink=no
;;
*)
if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
need_relink=yes
fi
;;
esac
# This is a shared library
# Warn about portability, can't link against -module's on some
# systems (darwin). Don't bleat about dlopened modules though!
dlopenmodule=""
for dlpremoduletest in $dlprefiles; do
if test "X$dlpremoduletest" = "X$lib"; then
dlopenmodule="$dlpremoduletest"
break
fi
done
if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
$ECHO
if test "$linkmode" = prog; then
$ECHO "*** Warning: Linking the executable $output against the loadable module"
else
$ECHO "*** Warning: Linking the shared library $output against the loadable module"
fi
$ECHO "*** $linklib is not portable!"
fi
if test "$linkmode" = lib &&
test "$hardcode_into_libs" = yes; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) compile_rpath="$compile_rpath $absdir"
esac
;;
esac
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir"
esac
;;
esac
fi
if test -n "$old_archive_from_expsyms_cmds"; then
# figure out the soname
set dummy $library_names
shift
realname="$1"
shift
libname=`eval "\\$ECHO \"$libname_spec\""`
# use dlname if we got it. it's perfectly good, no?
if test -n "$dlname"; then
soname="$dlname"
elif test -n "$soname_spec"; then
# bleh windows
case $host in
*cygwin* | mingw* | *cegcc*)
func_arith $current - $age
major=$func_arith_result
versuffix="-$major"
;;
esac
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
# Make a new name for the extract_expsyms_cmds to use
soroot="$soname"
func_basename "$soroot"
soname="$func_basename_result"
func_stripname 'lib' '.dll' "$soname"
newlib=libimp-$func_stripname_result.a
# If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then :
else
func_verbose "extracting exported symbol list from \`$soname'"
func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
fi
# Create $newlib
if test -f "$output_objdir/$newlib"; then :; else
func_verbose "generating import library for \`$soname'"
func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
fi
# make sure the library variables are pointing to the new library
dir=$output_objdir
linklib=$newlib
fi # test -n "$old_archive_from_expsyms_cmds"
if test "$linkmode" = prog || test "$mode" != relink; then
add_shlibpath=
add_dir=
add=
lib_linked=yes
case $hardcode_action in
immediate | unsupported)
if test "$hardcode_direct" = no; then
add="$dir/$linklib"
case $host in
*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
*-*-sysv4*uw2*) add_dir="-L$dir" ;;
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
*-*-unixware7*) add_dir="-L$dir" ;;
*-*-darwin* )
# if the lib is a (non-dlopened) module then we can not
# link against it, someone is ignoring the earlier warnings
if /usr/bin/file -L $add 2> /dev/null |
$GREP ": [^:]* bundle" >/dev/null ; then
if test "X$dlopenmodule" != "X$lib"; then
$ECHO "*** Warning: lib $linklib is a module, not a shared library"
if test -z "$old_library" ; then
$ECHO
$ECHO "*** And there doesn't seem to be a static archive available"
$ECHO "*** The link will probably fail, sorry"
else
add="$dir/$old_library"
fi
elif test -n "$old_library"; then
add="$dir/$old_library"
fi
fi
esac
elif test "$hardcode_minus_L" = no; then
case $host in
*-*-sunos*) add_shlibpath="$dir" ;;
esac
add_dir="-L$dir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = no; then
add_shlibpath="$dir"
add="-l$name"
else
lib_linked=no
fi
;;
relink)
if test "$hardcode_direct" = yes &&
test "$hardcode_direct_absolute" = no; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$dir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
add_dir="$add_dir -L$inst_prefix_dir$libdir"
;;
esac
fi
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
add_shlibpath="$dir"
add="-l$name"
else
lib_linked=no
fi
;;
*) lib_linked=no ;;
esac
if test "$lib_linked" != yes; then
func_fatal_configuration "unsupported hardcode properties"
fi
if test -n "$add_shlibpath"; then
case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
fi
if test "$linkmode" = prog; then
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
test -n "$add" && compile_deplibs="$add $compile_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
if test "$hardcode_direct" != yes &&
test "$hardcode_minus_L" != yes &&
test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
fi
fi
fi
if test "$linkmode" = prog || test "$mode" = relink; then
add_shlibpath=
add_dir=
add=
# Finalize command for both is simple: just hardcode it.
if test "$hardcode_direct" = yes &&
test "$hardcode_direct_absolute" = no; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
add="-l$name"
elif test "$hardcode_automatic" = yes; then
if test -n "$inst_prefix_dir" &&
test -f "$inst_prefix_dir$libdir/$linklib" ; then
add="$inst_prefix_dir$libdir/$linklib"
else
add="$libdir/$linklib"
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
add_dir="-L$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
add_dir="$add_dir -L$inst_prefix_dir$libdir"
;;
esac
fi
add="-l$name"
fi
if test "$linkmode" = prog; then
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
fi
fi
elif test "$linkmode" = prog; then
# Here we assume that one of hardcode_direct or hardcode_minus_L
# is not unsupported. This is valid on all known static and
# shared platforms.
if test "$hardcode_direct" != unsupported; then
test -n "$old_library" && linklib="$old_library"
compile_deplibs="$dir/$linklib $compile_deplibs"
finalize_deplibs="$dir/$linklib $finalize_deplibs"
else
compile_deplibs="-l$name -L$dir $compile_deplibs"
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
fi
elif test "$build_libtool_libs" = yes; then
# Not a shared library
if test "$deplibs_check_method" != pass_all; then
# We're trying link a shared library against a static one
# but the system doesn't support it.
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
$ECHO
$ECHO "*** Warning: This system can not link to static lib archive $lib."
$ECHO "*** I have the capability to make that library automatically link in when"
$ECHO "*** you link to this library. But I can only do this if you have a"
$ECHO "*** shared version of the library, which you do not appear to have."
if test "$module" = yes; then
$ECHO "*** But as you try to build a module library, libtool will still create "
$ECHO "*** a static module, that should work as long as the dlopening application"
$ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
$ECHO
$ECHO "*** However, this would only work if libtool was able to extract symbol"
$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
$ECHO "*** not find such a program. So, this module is probably useless."
$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
else
deplibs="$dir/$old_library $deplibs"
link_static=yes
fi
fi # link shared/static library?
if test "$linkmode" = lib; then
if test -n "$dependency_libs" &&
{ test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes ||
test "$link_static" = yes; }; then
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
case $libdir in
-R*) func_stripname '-R' '' "$libdir"
temp_xrpath=$func_stripname_result
case " $xrpath " in
*" $temp_xrpath "*) ;;
*) xrpath="$xrpath $temp_xrpath";;
esac;;
*) temp_deplibs="$temp_deplibs $libdir";;
esac
done
dependency_libs="$temp_deplibs"
fi
newlib_search_path="$newlib_search_path $absdir"
# Link against this library
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
# ... and its dependency_libs
tmp_libs=
for deplib in $dependency_libs; do
newdependency_libs="$deplib $newdependency_libs"
if $opt_duplicate_deps ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
if test "$link_all_deplibs" != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
case $deplib in
-L*) path="$deplib" ;;
*.la)
func_dirname "$deplib" "" "."
dir="$func_dirname_result"
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
func_warning "cannot determine absolute directory name of \`$dir'"
absdir="$dir"
fi
;;
esac
if $GREP "^installed=no" $deplib > /dev/null; then
case $host in
*-*-darwin*)
depdepl=
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
depdepl=$tmp
done
if test -f "$absdir/$objdir/$depdepl" ; then
depdepl="$absdir/$objdir/$depdepl"
darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
if test -z "$darwin_install_name"; then
darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
fi
compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
path=
fi
fi
;;
*)
path="-L$absdir/$objdir"
;;
esac
else
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
test -z "$libdir" && \
func_fatal_error "\`$deplib' is not a valid libtool archive"
test "$absdir" != "$libdir" && \
func_warning "\`$deplib' seems to be moved"
path="-L$absdir"
fi
;;
esac
case " $deplibs " in
*" $path "*) ;;
*) deplibs="$path $deplibs" ;;
esac
done
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
if test "$pass" = link; then
if test "$linkmode" = "prog"; then
compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
else
compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
fi
fi
dependency_libs="$newdependency_libs"
if test "$pass" = dlpreopen; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
deplibs="$deplib $deplibs"
done
fi
if test "$pass" != dlopen; then
if test "$pass" != conv; then
# Make sure lib_search_path contains only unique directories.
lib_search_path=
for dir in $newlib_search_path; do
case "$lib_search_path " in
*" $dir "*) ;;
*) lib_search_path="$lib_search_path $dir" ;;
esac
done
newlib_search_path=
fi
if test "$linkmode,$pass" != "prog,link"; then
vars="deplibs"
else
vars="compile_deplibs finalize_deplibs"
fi
for var in $vars dependency_libs; do
# Add libraries to $var in reverse order
eval tmp_libs=\"\$$var\"
new_libs=
for deplib in $tmp_libs; do
# FIXME: Pedantically, this is the right thing to do, so
# that some nasty dependency loop isn't accidentally
# broken:
#new_libs="$deplib $new_libs"
# Pragmatically, this seems to cause very few problems in
# practice:
case $deplib in
-L*) new_libs="$deplib $new_libs" ;;
-R*) ;;
*)
# And here is the reason: when a library appears more
# than once as an explicit dependence of a library, or
# is implicitly linked in more than once by the
# compiler, it is considered special, and multiple
# occurrences thereof are not removed. Compare this
# with having the same library being listed as a
# dependency of multiple other libraries: in this case,
# we know (pedantically, we assume) the library does not
# need to be listed more than once, so we keep only the
# last copy. This is not always right, but it is rare
# enough that we require users that really mean to play
# such unportable linking tricks to link the library
# using -Wl,-lname, so that libtool does not consider it
# for duplicate removal.
case " $specialdeplibs " in
*" $deplib "*) new_libs="$deplib $new_libs" ;;
*)
case " $new_libs " in
*" $deplib "*) ;;
*) new_libs="$deplib $new_libs" ;;
esac
;;
esac
;;
esac
done
tmp_libs=
for deplib in $new_libs; do
case $deplib in
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
*) tmp_libs="$tmp_libs $deplib" ;;
esac
;;
*) tmp_libs="$tmp_libs $deplib" ;;
esac
done
eval $var=\"$tmp_libs\"
done # for var
fi
# Last step: remove runtime libs from dependency_libs
# (they stay in deplibs)
tmp_libs=
for i in $dependency_libs ; do
case " $predeps $postdeps $compiler_lib_search_path " in
*" $i "*)
i=""
;;
esac
if test -n "$i" ; then
tmp_libs="$tmp_libs $i"
fi
done
dependency_libs=$tmp_libs
done # for pass
if test "$linkmode" = prog; then
dlfiles="$newdlfiles"
fi
if test "$linkmode" = prog || test "$linkmode" = lib; then
dlprefiles="$newdlprefiles"
fi
case $linkmode in
oldlib)
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
func_warning "\`-dlopen' is ignored for archives"
fi
case " $deplibs" in
*\ -l* | *\ -L*)
func_warning "\`-l' and \`-L' are ignored for archives" ;;
esac
test -n "$rpath" && \
func_warning "\`-rpath' is ignored for archives"
test -n "$xrpath" && \
func_warning "\`-R' is ignored for archives"
test -n "$vinfo" && \
func_warning "\`-version-info/-version-number' is ignored for archives"
test -n "$release" && \
func_warning "\`-release' is ignored for archives"
test -n "$export_symbols$export_symbols_regex" && \
func_warning "\`-export-symbols' is ignored for archives"
# Now set the variables for building old libraries.
build_libtool_libs=no
oldlibs="$output"
objs="$objs$old_deplibs"
;;
lib)
# Make sure we only generate libraries of the form `libNAME.la'.
case $outputname in
lib*)
func_stripname 'lib' '.la' "$outputname"
name=$func_stripname_result
eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\"
;;
*)
test "$module" = no && \
func_fatal_help "libtool library \`$output' must begin with \`lib'"
if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required
func_stripname '' '.la' "$outputname"
name=$func_stripname_result
eval shared_ext=\"$shrext_cmds\"
eval libname=\"$libname_spec\"
else
func_stripname '' '.la' "$outputname"
libname=$func_stripname_result
fi
;;
esac
if test -n "$objs"; then
if test "$deplibs_check_method" != pass_all; then
func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
else
$ECHO
$ECHO "*** Warning: Linking the shared library $output against the non-libtool"
$ECHO "*** objects $objs is not portable!"
libobjs="$libobjs $objs"
fi
fi
test "$dlself" != no && \
func_warning "\`-dlopen self' is ignored for libtool libraries"
set dummy $rpath
shift
test "$#" -gt 1 && \
func_warning "ignoring multiple \`-rpath's for a libtool library"
install_libdir="$1"
oldlibs=
if test -z "$rpath"; then
if test "$build_libtool_libs" = yes; then
# Building a libtool convenience library.
# Some compilers have problems with a `.al' extension so
# convenience libraries should have the same extension an
# archive normally would.
oldlibs="$output_objdir/$libname.$libext $oldlibs"
build_libtool_libs=convenience
build_old_libs=yes
fi
test -n "$vinfo" && \
func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
test -n "$release" && \
func_warning "\`-release' is ignored for convenience libraries"
else
# Parse the version information argument.
save_ifs="$IFS"; IFS=':'
set dummy $vinfo 0 0 0
shift
IFS="$save_ifs"
test -n "$7" && \
func_fatal_help "too many parameters to \`-version-info'"
# convert absolute version numbers to libtool ages
# this retains compatibility with .la files and attempts
# to make the code below a bit more comprehensible
case $vinfo_number in
yes)
number_major="$1"
number_minor="$2"
number_revision="$3"
#
# There are really only two kinds -- those that
# use the current revision as the major version
# and those that subtract age and use age as
# a minor version. But, then there is irix
# which has an extra 1 added just for fun
#
case $version_type in
darwin|linux|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
age="$number_minor"
revision="$number_revision"
;;
freebsd-aout|freebsd-elf|sunos)
current="$number_major"
revision="$number_minor"
age="0"
;;
irix|nonstopux)
func_arith $number_major + $number_minor
current=$func_arith_result
age="$number_minor"
revision="$number_minor"
lt_irix_increment=no
;;
esac
;;
no)
current="$1"
revision="$2"
age="$3"
;;
esac
# Check that each of the things are valid numbers.
case $current in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
func_error "CURRENT \`$current' must be a nonnegative integer"
func_fatal_error "\`$vinfo' is not valid version information"
;;
esac
case $revision in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
func_error "REVISION \`$revision' must be a nonnegative integer"
func_fatal_error "\`$vinfo' is not valid version information"
;;
esac
case $age in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
func_error "AGE \`$age' must be a nonnegative integer"
func_fatal_error "\`$vinfo' is not valid version information"
;;
esac
if test "$age" -gt "$current"; then
func_error "AGE \`$age' is greater than the current interface number \`$current'"
func_fatal_error "\`$vinfo' is not valid version information"
fi
# Calculate the version variables.
major=
versuffix=
verstring=
case $version_type in
none) ;;
darwin)
# Like Linux, but with the current version available in
# verstring for coding it into the library header
func_arith $current - $age
major=.$func_arith_result
versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options...
func_arith $current + 1
minor_current=$func_arith_result
xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;;
freebsd-aout)
major=".$current"
versuffix=".$current.$revision";
;;
freebsd-elf)
major=".$current"
versuffix=".$current"
;;
irix | nonstopux)
if test "X$lt_irix_increment" = "Xno"; then
func_arith $current - $age
else
func_arith $current - $age + 1
fi
major=$func_arith_result
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
esac
verstring="$verstring_prefix$major.$revision"
# Add in all the interfaces that we are compatible with.
loop=$revision
while test "$loop" -ne 0; do
func_arith $revision - $loop
iface=$func_arith_result
func_arith $loop - 1
loop=$func_arith_result
verstring="$verstring_prefix$major.$iface:$verstring"
done
# Before this point, $major must not contain `.'.
major=.$major
versuffix="$major.$revision"
;;
linux)
func_arith $current - $age
major=.$func_arith_result
versuffix="$major.$age.$revision"
;;
osf)
func_arith $current - $age
major=.$func_arith_result
versuffix=".$current.$age.$revision"
verstring="$current.$age.$revision"
# Add in all the interfaces that we are compatible with.
loop=$age
while test "$loop" -ne 0; do
func_arith $current - $loop
iface=$func_arith_result
func_arith $loop - 1
loop=$func_arith_result
verstring="$verstring:${iface}.0"
done
# Make executables depend on our current version.
verstring="$verstring:${current}.0"
;;
qnx)
major=".$current"
versuffix=".$current"
;;
sunos)
major=".$current"
versuffix=".$current.$revision"
;;
windows)
# Use '-' rather than '.', since we only want one
# extension on DOS 8.3 filesystems.
func_arith $current - $age
major=$func_arith_result
versuffix="-$major"
;;
*)
func_fatal_configuration "unknown library version type \`$version_type'"
;;
esac
# Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then
major=
case $version_type in
darwin)
# we can't check for "0.0" in archive_cmds due to quoting
# problems, so we reset it completely
verstring=
;;
*)
verstring="0.0"
;;
esac
if test "$need_version" = no; then
versuffix=
else
versuffix=".0.0"
fi
fi
# Remove version info from name if versioning should be avoided
if test "$avoid_version" = yes && test "$need_version" = no; then
major=
versuffix=
verstring=""
fi
# Check to see if the archive will have undefined symbols.
if test "$allow_undefined" = yes; then
if test "$allow_undefined_flag" = unsupported; then
func_warning "undefined symbols not allowed in $host shared libraries"
build_libtool_libs=no
build_old_libs=yes
fi
else
# Don't allow undefined symbols.
allow_undefined_flag="$no_undefined_flag"
fi
fi
func_generate_dlsyms "$libname" "$libname" "yes"
libobjs="$libobjs $symfileobj"
test "X$libobjs" = "X " && libobjs=
if test "$mode" != relink; then
# Remove our outputs, but don't remove object files since they
# may have been created when compiling PIC objects.
removelist=
tempremovelist=`$ECHO "$output_objdir/*"`
for p in $tempremovelist; do
case $p in
*.$objext | *.gcno)
;;
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
if test "X$precious_files_regex" != "X"; then
if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
then
continue
fi
fi
removelist="$removelist $p"
;;
*) ;;
esac
done
test -n "$removelist" && \
func_show_eval "${RM}r \$removelist"
fi
# Now set the variables for building old libraries.
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
oldlibs="$oldlibs $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
#for path in $notinst_path; do
# lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
# deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
# dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
#done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
temp_xrpath=
for libdir in $xrpath; do
temp_xrpath="$temp_xrpath -R$libdir"
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
dependency_libs="$temp_xrpath $dependency_libs"
fi
fi
# Make sure dlfiles contains only unique files that won't be dlpreopened
old_dlfiles="$dlfiles"
dlfiles=
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
*" $lib "*) ;;
*) dlfiles="$dlfiles $lib" ;;
esac
done
# Make sure dlprefiles contains only unique files
old_dlprefiles="$dlprefiles"
dlprefiles=
for lib in $old_dlprefiles; do
case "$dlprefiles " in
*" $lib "*) ;;
*) dlprefiles="$dlprefiles $lib" ;;
esac
done
if test "$build_libtool_libs" = yes; then
if test -n "$rpath"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
deplibs="$deplibs System.ltframework"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
# Do not include libc due to us having libc/libc_r.
;;
*-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype
;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work
;;
*)
# Add libc to deplibs on all other systems if necessary.
if test "$build_libtool_need_lc" = "yes"; then
deplibs="$deplibs -lc"
fi
;;
esac
fi
# Transform deplibs into only deplibs that can be linked in shared.
name_save=$name
libname_save=$libname
release_save=$release
versuffix_save=$versuffix
major_save=$major
# I'm not sure if I'm treating the release correctly. I think
# release should show up in the -l (ie -lgmp5) so we don't want to
# add it in twice. Is that correct?
release=""
versuffix=""
major=""
newdeplibs=
droppeddeps=no
case $deplibs_check_method in
pass_all)
# Don't check for shared/static. Everything works.
# This might be a little naive. We might want to check
# whether the library exists or not. But this is on
# osf3 & osf4 and I'm not really sure... Just
# implementing what was already the behavior.
newdeplibs=$deplibs
;;
test_compile)
# This code stresses the "libraries are programs" paradigm to its
# limits. Maybe even breaks it. We compile a program, linking it
# against the deplibs as a proxy for the library. Then we can check
# whether they linked in statically or dynamically with ldd.
$opt_dry_run || $RM conftest.c
cat > conftest.c </dev/null`
for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null |
$GREP " -> " >/dev/null; then
continue
fi
# The statement above tries to avoid entering an
# endless loop below, in case of cyclic links.
# We might still enter an endless loop, since a link
# loop can be closed while we follow links,
# but so what?
potlib="$potent_lib"
while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
$SED -e 10q |
$EGREP "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
done
done
fi
if test -n "$a_deplib" ; then
droppeddeps=yes
$ECHO
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
$ECHO "*** I have the capability to make that library automatically link in when"
$ECHO "*** you link to this library. But I can only do this if you have a"
$ECHO "*** shared version of the library, which you do not appear to have"
$ECHO "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
$ECHO "*** with $libname but no candidates were found. (...for file magic test)"
else
$ECHO "*** with $libname and none of the candidates passed a file format test"
$ECHO "*** using a file magic. Last file checked: $potlib"
fi
fi
;;
*)
# Add a -L argument.
newdeplibs="$newdeplibs $a_deplib"
;;
esac
done # Gone through all deplibs.
;;
match_pattern*)
set dummy $deplibs_check_method; shift
match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
for a_deplib in $deplibs; do
case $a_deplib in
-l*)
func_stripname -l '' "$a_deplib"
name=$func_stripname_result
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $a_deplib "*)
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
;;
esac
fi
if test -n "$a_deplib" ; then
libname=`eval "\\$ECHO \"$libname_spec\""`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
potlib="$potent_lib" # see symlink-check above in file_magic test
if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
$EGREP "$match_pattern_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
done
done
fi
if test -n "$a_deplib" ; then
droppeddeps=yes
$ECHO
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
$ECHO "*** I have the capability to make that library automatically link in when"
$ECHO "*** you link to this library. But I can only do this if you have a"
$ECHO "*** shared version of the library, which you do not appear to have"
$ECHO "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
$ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
else
$ECHO "*** with $libname and none of the candidates passed a file format test"
$ECHO "*** using a regex pattern. Last file checked: $potlib"
fi
fi
;;
*)
# Add a -L argument.
newdeplibs="$newdeplibs $a_deplib"
;;
esac
done # Gone through all deplibs.
;;
none | unknown | *)
newdeplibs=""
tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
-e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
for i in $predeps $postdeps ; do
# can't use Xsed below, because $i might contain '/'
tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
done
fi
if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
$GREP . >/dev/null; then
$ECHO
if test "X$deplibs_check_method" = "Xnone"; then
$ECHO "*** Warning: inter-library dependencies are not supported in this platform."
else
$ECHO "*** Warning: inter-library dependencies are not known to be supported."
fi
$ECHO "*** All declared inter-library dependencies are being dropped."
droppeddeps=yes
fi
;;
esac
versuffix=$versuffix_save
major=$major_save
release=$release_save
libname=$libname_save
name=$name_save
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library with the System framework
newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
;;
esac
if test "$droppeddeps" = yes; then
if test "$module" = yes; then
$ECHO
$ECHO "*** Warning: libtool could not satisfy all declared inter-library"
$ECHO "*** dependencies of module $libname. Therefore, libtool will create"
$ECHO "*** a static module, that should work as long as the dlopening"
$ECHO "*** application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
$ECHO
$ECHO "*** However, this would only work if libtool was able to extract symbol"
$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
$ECHO "*** not find such a program. So, this module is probably useless."
$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
else
$ECHO "*** The inter-library dependencies that have been dropped here will be"
$ECHO "*** automatically added whenever a program is linked with this library"
$ECHO "*** or is declared to -dlopen it."
if test "$allow_undefined" = no; then
$ECHO
$ECHO "*** Since this library must not contain undefined symbols,"
$ECHO "*** because either the platform does not support them or"
$ECHO "*** it was explicitly requested with -no-undefined,"
$ECHO "*** libtool will only create a static version of it."
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
fi
fi
# Done checking deplibs!
deplibs=$newdeplibs
fi
# Time to change all our "foo.ltframework" stuff back to "-framework foo"
case $host in
*-*-darwin*)
newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
;;
esac
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=
for path in $notinst_path; do
case " $new_libs " in
*" -L$path/$objdir "*) ;;
*)
case " $deplibs " in
*" -L$path/$objdir "*)
new_libs="$new_libs -L$path/$objdir" ;;
esac
;;
esac
done
for deplib in $deplibs; do
case $deplib in
-L*)
case " $new_libs " in
*" $deplib "*) ;;
*) new_libs="$new_libs $deplib" ;;
esac
;;
*) new_libs="$new_libs $deplib" ;;
esac
done
deplibs="$new_libs"
# All the library-specific variables (install_libdir is set above).
library_names=
old_library=
dlname=
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
rpath="$finalize_rpath"
test "$mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
dep_rpath="$dep_rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
if test -n "$hardcode_libdir_flag_spec_ld"; then
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
else
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
fi
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
rpath="$rpath$dir:"
done
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
fi
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
fi
shlibpath="$finalize_shlibpath"
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
# Get the real and link names of the library.
eval shared_ext=\"$shrext_cmds\"
eval library_names=\"$library_names_spec\"
set dummy $library_names
shift
realname="$1"
shift
if test -n "$soname_spec"; then
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
if test -z "$dlname"; then
dlname=$soname
fi
lib="$output_objdir/$realname"
linknames=
for link
do
linknames="$linknames $link"
done
# Use standard objects if they are pic
test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
test "X$libobjs" = "X " && libobjs=
delfiles=
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
export_symbols="$output_objdir/$libname.uexp"
delfiles="$delfiles $export_symbols"
fi
orig_export_symbols=
case $host_os in
cygwin* | mingw* | cegcc*)
if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
# exporting using user supplied symfile
if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
# and it's NOT already a .def file. Must figure out
# which of the given symbols are data symbols and tag
# them as such. So, trigger use of export_symbols_cmds.
# export_symbols gets reassigned inside the "prepare
# the list of exported symbols" if statement, so the
# include_expsyms logic still works.
orig_export_symbols="$export_symbols"
export_symbols=
always_export_symbols=yes
fi
fi
;;
esac
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
func_verbose "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
$opt_dry_run || $RM $export_symbols
cmds=$export_symbols_cmds
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
func_len " $cmd"
len=$func_len_result
if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
func_show_eval "$cmd" 'exit $?'
skipped_export=false
else
# The command line is too long to execute in one step.
func_verbose "using reloadable object file for export list..."
skipped_export=:
# Break out early, otherwise skipped_export may be
# set to false by a later but shorter cmd.
break
fi
done
IFS="$save_ifs"
if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
fi
fi
fi
if test -n "$export_symbols" && test -n "$include_expsyms"; then
tmp_export_symbols="$export_symbols"
test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
$opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
fi
if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
# The given exports_symbols file has to be filtered, so filter it.
func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
# FIXME: $output_objdir/$libname.filter potentially contains lots of
# 's' commands which not all seds can handle. GNU sed should be fine
# though. Also, the filter scales superlinearly with the number of
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
tmp_deplibs=
for test_deplib in $deplibs; do
case " $convenience " in
*" $test_deplib "*) ;;
*)
tmp_deplibs="$tmp_deplibs $test_deplib"
;;
esac
done
deplibs="$tmp_deplibs"
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec" &&
test "$compiler_needs_object" = yes &&
test -z "$libobjs"; then
# extract the archives, so we have objects to list.
# TODO: could optimize this to just extract one archive.
whole_archive_flag_spec=
fi
if test -n "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
test "X$libobjs" = "X " && libobjs=
else
gentop="$output_objdir/${outputname}x"
generated="$generated $gentop"
func_extract_archives $gentop $convenience
libobjs="$libobjs $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
fi
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
linker_flags="$linker_flags $flag"
fi
# Make a backup of the uninstalled library when relinking
if test "$mode" = relink; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
if test "$module" = yes && test -n "$module_cmds" ; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
eval test_cmds=\"$module_expsym_cmds\"
cmds=$module_expsym_cmds
else
eval test_cmds=\"$module_cmds\"
cmds=$module_cmds
fi
else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval test_cmds=\"$archive_expsym_cmds\"
cmds=$archive_expsym_cmds
else
eval test_cmds=\"$archive_cmds\"
cmds=$archive_cmds
fi
fi
if test "X$skipped_export" != "X:" &&
func_len " $test_cmds" &&
len=$func_len_result &&
test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
:
else
# The command line is too long to link in one step, link piecewise
# or, if using GNU ld and skipped_export is not :, use a linker
# script.
# Save the value of $output and $libobjs because we want to
# use them later. If we have whole_archive_flag_spec, we
# want to use save_libobjs as it was before
# whole_archive_flag_spec was expanded, because we can't
# assume the linker understands whole_archive_flag_spec.
# This may have to be revisited, in case too many
# convenience libraries get linked in and end up exceeding
# the spec.
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
fi
save_output=$output
output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
# Clear the reloadable object creation command queue and
# initialize k to one.
test_cmds=
concat_cmds=
objlist=
last_robj=
k=1
if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
output=${output_objdir}/${output_la}.lnkscript
func_verbose "creating GNU ld script: $output"
$ECHO 'INPUT (' > $output
for obj in $save_libobjs
do
$ECHO "$obj" >> $output
done
$ECHO ')' >> $output
delfiles="$delfiles $output"
elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
output=${output_objdir}/${output_la}.lnk
func_verbose "creating linker input file list: $output"
: > $output
set x $save_libobjs
shift
firstobj=
if test "$compiler_needs_object" = yes; then
firstobj="$1 "
shift
fi
for obj
do
$ECHO "$obj" >> $output
done
delfiles="$delfiles $output"
output=$firstobj\"$file_list_spec$output\"
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
output=$output_objdir/$output_la-${k}.$objext
eval test_cmds=\"$reload_cmds\"
func_len " $test_cmds"
len0=$func_len_result
len=$len0
# Loop over the list of objects to be linked.
for obj in $save_libobjs
do
func_len " $obj"
func_arith $len + $func_len_result
len=$func_arith_result
if test "X$objlist" = X ||
test "$len" -lt "$max_cmd_len"; then
func_append objlist " $obj"
else
# The command $test_cmds is almost too long, add a
# command to the queue.
if test "$k" -eq 1 ; then
# The first file doesn't have a previous command to add.
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
else
# All subsequent reloadable object files will link in
# the last one created.
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
fi
last_robj=$output_objdir/$output_la-${k}.$objext
func_arith $k + 1
k=$func_arith_result
output=$output_objdir/$output_la-${k}.$objext
objlist=$obj
func_len " $last_robj"
func_arith $len0 + $func_len_result
len=$func_arith_result
fi
done
# Handle the remaining objects by creating one last
# reloadable object file. All subsequent reloadable object
# files will link in the last one created.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
if test -n "$last_robj"; then
eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
fi
delfiles="$delfiles $output"
else
output=
fi
if ${skipped_export-false}; then
func_verbose "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
$opt_dry_run || $RM $export_symbols
libobjs=$output
# Append the command to create the export file.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
if test -n "$last_robj"; then
eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
fi
fi
test -n "$save_libobjs" &&
func_verbose "creating a temporary reloadable object file: $output"
# Loop through the commands generated above and execute them.
save_ifs="$IFS"; IFS='~'
for cmd in $concat_cmds; do
IFS="$save_ifs"
$opt_silent || {
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
# Restore the uninstalled library and exit
if test "$mode" = relink; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
fi
exit $lt_exit
}
done
IFS="$save_ifs"
if test -n "$export_symbols_regex" && ${skipped_export-false}; then
func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
fi
fi
if ${skipped_export-false}; then
if test -n "$export_symbols" && test -n "$include_expsyms"; then
tmp_export_symbols="$export_symbols"
test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
$opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
fi
if test -n "$orig_export_symbols"; then
# The given exports_symbols file has to be filtered, so filter it.
func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
# FIXME: $output_objdir/$libname.filter potentially contains lots of
# 's' commands which not all seds can handle. GNU sed should be fine
# though. Also, the filter scales superlinearly with the number of
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
fi
libobjs=$output
# Restore the value of output.
output=$save_output
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
test "X$libobjs" = "X " && libobjs=
fi
# Expand the library linking commands again to reset the
# value of $libobjs for piecewise linking.
# Do each of the archive commands.
if test "$module" = yes && test -n "$module_cmds" ; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
cmds=$module_expsym_cmds
else
cmds=$module_cmds
fi
else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
cmds=$archive_expsym_cmds
else
cmds=$archive_cmds
fi
fi
fi
if test -n "$delfiles"; then
# Append the command to remove temporary files to $cmds.
eval cmds=\"\$cmds~\$RM $delfiles\"
fi
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
gentop="$output_objdir/${outputname}x"
generated="$generated $gentop"
func_extract_archives $gentop $dlprefiles
libobjs="$libobjs $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
eval cmd=\"$cmd\"
$opt_silent || {
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
# Restore the uninstalled library and exit
if test "$mode" = relink; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
fi
exit $lt_exit
}
done
IFS="$save_ifs"
# Restore the uninstalled library and exit
if test "$mode" = relink; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
if test -n "$convenience"; then
if test -z "$whole_archive_flag_spec"; then
func_show_eval '${RM}r "$gentop"'
fi
fi
exit $EXIT_SUCCESS
fi
# Create links to the real library.
for linkname in $linknames; do
if test "$realname" != "$linkname"; then
func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
fi
done
# If -module or -export-dynamic was specified, set the dlname.
if test "$module" = yes || test "$export_dynamic" = yes; then
# On all known operating systems, these are identical.
dlname="$soname"
fi
fi
;;
obj)
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
func_warning "\`-dlopen' is ignored for objects"
fi
case " $deplibs" in
*\ -l* | *\ -L*)
func_warning "\`-l' and \`-L' are ignored for objects" ;;
esac
test -n "$rpath" && \
func_warning "\`-rpath' is ignored for objects"
test -n "$xrpath" && \
func_warning "\`-R' is ignored for objects"
test -n "$vinfo" && \
func_warning "\`-version-info' is ignored for objects"
test -n "$release" && \
func_warning "\`-release' is ignored for objects"
case $output in
*.lo)
test -n "$objs$old_deplibs" && \
func_fatal_error "cannot build library object \`$output' from non-libtool objects"
libobj=$output
func_lo2o "$libobj"
obj=$func_lo2o_result
;;
*)
libobj=
obj="$output"
;;
esac
# Delete the old objects.
$opt_dry_run || $RM $obj $libobj
# Objects from convenience libraries. This assumes
# single-version convenience libraries. Whenever we create
# different ones for PIC/non-PIC, this we'll have to duplicate
# the extraction.
reload_conv_objs=
gentop=
# reload_cmds runs $LD directly, so let us get rid of
# -Wl from whole_archive_flag_spec and hope we can get by with
# turning comma into space..
wl=
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
else
gentop="$output_objdir/${obj}x"
generated="$generated $gentop"
func_extract_archives $gentop $convenience
reload_conv_objs="$reload_objs $func_extract_archives_result"
fi
fi
# Create the old-style object.
reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
output="$obj"
func_execute_cmds "$reload_cmds" 'exit $?'
# Exit if we aren't doing a library object file.
if test -z "$libobj"; then
if test -n "$gentop"; then
func_show_eval '${RM}r "$gentop"'
fi
exit $EXIT_SUCCESS
fi
if test "$build_libtool_libs" != yes; then
if test -n "$gentop"; then
func_show_eval '${RM}r "$gentop"'
fi
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
# $show "echo timestamp > $libobj"
# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
exit $EXIT_SUCCESS
fi
if test -n "$pic_flag" || test "$pic_mode" != default; then
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs"
output="$libobj"
func_execute_cmds "$reload_cmds" 'exit $?'
fi
if test -n "$gentop"; then
func_show_eval '${RM}r "$gentop"'
fi
exit $EXIT_SUCCESS
;;
prog)
case $host in
*cygwin*) func_stripname '' '.exe' "$output"
output=$func_stripname_result.exe;;
esac
test -n "$vinfo" && \
func_warning "\`-version-info' is ignored for programs"
test -n "$release" && \
func_warning "\`-release' is ignored for programs"
test "$preload" = yes \
&& test "$dlopen_support" = unknown \
&& test "$dlopen_self" = unknown \
&& test "$dlopen_self_static" = unknown && \
func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
;;
esac
case $host in
*-*-darwin*)
# Don't allow lazy linking, it breaks C++ global constructors
# But is supposedly fixed on 10.4 or later (yay!).
if test "$tagname" = CXX ; then
case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10.[0123])
compile_command="$compile_command ${wl}-bind_at_load"
finalize_command="$finalize_command ${wl}-bind_at_load"
;;
esac
fi
# Time to change all our "foo.ltframework" stuff back to "-framework foo"
compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
;;
esac
# move library search paths that coincide with paths to not yet
# installed libraries to the beginning of the library search list
new_libs=
for path in $notinst_path; do
case " $new_libs " in
*" -L$path/$objdir "*) ;;
*)
case " $compile_deplibs " in
*" -L$path/$objdir "*)
new_libs="$new_libs -L$path/$objdir" ;;
esac
;;
esac
done
for deplib in $compile_deplibs; do
case $deplib in
-L*)
case " $new_libs " in
*" $deplib "*) ;;
*) new_libs="$new_libs $deplib" ;;
esac
;;
*) new_libs="$new_libs $deplib" ;;
esac
done
compile_deplibs="$new_libs"
compile_command="$compile_command $compile_deplibs"
finalize_command="$finalize_command $finalize_deplibs"
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
for libdir in $rpath $xrpath; do
# This is the magic to use -rpath.
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
fi
# Now hardcode the library paths
rpath=
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$libdir:"*) ;;
::) dllsearchpath=$libdir;;
*) dllsearchpath="$dllsearchpath:$libdir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
*) dllsearchpath="$dllsearchpath:$testbindir";;
esac
;;
esac
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
compile_rpath="$rpath"
rpath=
hardcode_libdirs=
for libdir in $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
*" $libdir "*) ;;
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
finalize_rpath="$rpath"
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
fi
func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
# template prelinking step
if test -n "$prelink_cmds"; then
func_execute_cmds "$prelink_cmds" 'exit $?'
fi
wrappers_required=yes
case $host in
*cygwin* | *mingw* )
if test "$build_libtool_libs" != yes; then
wrappers_required=no
fi
;;
*cegcc)
# Disable wrappers for cegcc, we are cross compiling anyway.
wrappers_required=no
;;
*)
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
wrappers_required=no
fi
;;
esac
if test "$wrappers_required" = no; then
# Replace the output file specification.
compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
exit_status=0
func_show_eval "$link_command" 'exit_status=$?'
# Delete the generated files.
if test -f "$output_objdir/${outputname}S.${objext}"; then
func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
fi
exit $exit_status
fi
if test -n "$compile_shlibpath$finalize_shlibpath"; then
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
fi
if test -n "$finalize_shlibpath"; then
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
fi
compile_var=
finalize_var=
if test -n "$runpath_var"; then
if test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
rpath="$rpath$dir:"
done
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
if test -n "$finalize_perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $finalize_perm_rpath; do
rpath="$rpath$dir:"
done
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
fi
if test "$no_install" = yes; then
# We don't need to create a wrapper script.
link_command="$compile_var$compile_command$compile_rpath"
# Replace the output file specification.
link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
$opt_dry_run || $RM $output
# Link the executable and exit
func_show_eval "$link_command" 'exit $?'
exit $EXIT_SUCCESS
fi
if test "$hardcode_action" = relink; then
# Fast installation is not supported
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
func_warning "this platform does not like uninstalled shared libraries"
func_warning "\`$output' will be relinked during installation"
else
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
else
# fast_install is set to needless
relink_command=
fi
else
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
fi
fi
# Replace the output file specification.
link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
# Delete the old output files.
$opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
func_show_eval "$link_command" 'exit $?'
# Now create the wrapper script.
func_verbose "creating $output"
# Quote the relink command for shipping.
if test -n "$relink_command"; then
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
func_quote_for_eval "$var_value"
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
relink_command="(cd `pwd`; $relink_command)"
relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
fi
# Quote $ECHO for shipping.
if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
case $progpath in
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
esac
qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
else
qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
fi
# Only actually do things if not in dry run mode.
$opt_dry_run || {
# win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here.
case $output in
*.exe) func_stripname '' '.exe' "$output"
output=$func_stripname_result ;;
esac
# test for cygwin because mv fails w/o .exe extensions
case $host in
*cygwin*)
exeext=.exe
func_stripname '' '.exe' "$outputname"
outputname=$func_stripname_result ;;
*) exeext= ;;
esac
case $host in
*cygwin* | *mingw* )
func_dirname_and_basename "$output" "" "."
output_name=$func_basename_result
output_path=$func_dirname_result
cwrappersource="$output_path/$objdir/lt-$output_name.c"
cwrapper="$output_path/$output_name.exe"
$RM $cwrappersource $cwrapper
trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
func_emit_cwrapperexe_src > $cwrappersource
# The wrapper executable is built using the $host compiler,
# because it contains $host paths and files. If cross-
# compiling, it, like the target executable, must be
# executed on the $host or under an emulation environment.
$opt_dry_run || {
$LTCC $LTCFLAGS -o $cwrapper $cwrappersource
$STRIP $cwrapper
}
# Now, create the wrapper script for func_source use:
func_ltwrapper_scriptname $cwrapper
$RM $func_ltwrapper_scriptname_result
trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
$opt_dry_run || {
# note: this script will not be executed, so do not chmod.
if test "x$build" = "x$host" ; then
$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
else
func_emit_wrapper no > $func_ltwrapper_scriptname_result
fi
}
;;
* )
$RM $output
trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
func_emit_wrapper no > $output
chmod +x $output
;;
esac
}
exit $EXIT_SUCCESS
;;
esac
# See if we need to build an old-fashioned archive.
for oldlib in $oldlibs; do
if test "$build_libtool_libs" = convenience; then
oldobjs="$libobjs_save $symfileobj"
addlibs="$convenience"
build_libtool_libs=no
else
if test "$build_libtool_libs" = module; then
oldobjs="$libobjs_save"
build_libtool_libs=no
else
oldobjs="$old_deplibs $non_pic_objects"
if test "$preload" = yes && test -f "$symfileobj"; then
oldobjs="$oldobjs $symfileobj"
fi
fi
addlibs="$old_convenience"
fi
if test -n "$addlibs"; then
gentop="$output_objdir/${outputname}x"
generated="$generated $gentop"
func_extract_archives $gentop $addlibs
oldobjs="$oldobjs $func_extract_archives_result"
fi
# Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
cmds=$old_archive_from_new_cmds
else
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
gentop="$output_objdir/${outputname}x"
generated="$generated $gentop"
func_extract_archives $gentop $dlprefiles
oldobjs="$oldobjs $func_extract_archives_result"
fi
# POSIX demands no paths to be encoded in archives. We have
# to avoid creating archives with duplicate basenames if we
# might have to extract them afterwards, e.g., when creating a
# static archive out of a convenience library, or when linking
# the entirety of a libtool archive into another (currently
# not supported by libtool).
if (for obj in $oldobjs
do
func_basename "$obj"
$ECHO "$func_basename_result"
done | sort | sort -uc >/dev/null 2>&1); then
:
else
$ECHO "copying selected object files to avoid basename conflicts..."
gentop="$output_objdir/${outputname}x"
generated="$generated $gentop"
func_mkdir_p "$gentop"
save_oldobjs=$oldobjs
oldobjs=
counter=1
for obj in $save_oldobjs
do
func_basename "$obj"
objbase="$func_basename_result"
case " $oldobjs " in
" ") oldobjs=$obj ;;
*[\ /]"$objbase "*)
while :; do
# Make sure we don't pick an alternate name that also
# overlaps.
newobj=lt$counter-$objbase
func_arith $counter + 1
counter=$func_arith_result
case " $oldobjs " in
*[\ /]"$newobj "*) ;;
*) if test ! -f "$gentop/$newobj"; then break; fi ;;
esac
done
func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
oldobjs="$oldobjs $gentop/$newobj"
;;
*) oldobjs="$oldobjs $obj" ;;
esac
done
fi
eval cmds=\"$old_archive_cmds\"
func_len " $cmds"
len=$func_len_result
if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cmds=$old_archive_cmds
else
# the command line is too long to link in one step, link in parts
func_verbose "using piecewise archive linking..."
save_RANLIB=$RANLIB
RANLIB=:
objlist=
concat_cmds=
save_oldobjs=$oldobjs
oldobjs=
# Is there a better way of finding the last object in the list?
for obj in $save_oldobjs
do
last_oldobj=$obj
done
eval test_cmds=\"$old_archive_cmds\"
func_len " $test_cmds"
len0=$func_len_result
len=$len0
for obj in $save_oldobjs
do
func_len " $obj"
func_arith $len + $func_len_result
len=$func_arith_result
func_append objlist " $obj"
if test "$len" -lt "$max_cmd_len"; then
:
else
# the above command should be used before it gets too long
oldobjs=$objlist
if test "$obj" = "$last_oldobj" ; then
RANLIB=$save_RANLIB
fi
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
objlist=
len=$len0
fi
done
RANLIB=$save_RANLIB
oldobjs=$objlist
if test "X$oldobjs" = "X" ; then
eval cmds=\"\$concat_cmds\"
else
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
fi
fi
fi
func_execute_cmds "$cmds" 'exit $?'
done
test -n "$generated" && \
func_show_eval "${RM}r$generated"
# Now create the libtool archive.
case $output in
*.la)
old_library=
test "$build_old_libs" = yes && old_library="$libname.$libext"
func_verbose "creating $output"
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
func_quote_for_eval "$var_value"
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
# Only create the output if not a dry run.
$opt_dry_run || {
for installed in no yes; do
if test "$installed" = yes; then
if test -z "$install_libdir"; then
break
fi
output="$output_objdir/$outputname"i
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
case $deplib in
*.la)
func_basename "$deplib"
name="$func_basename_result"
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
test -z "$libdir" && \
func_fatal_error "\`$deplib' is not a valid libtool archive"
newdependency_libs="$newdependency_libs $libdir/$name"
;;
*) newdependency_libs="$newdependency_libs $deplib" ;;
esac
done
dependency_libs="$newdependency_libs"
newdlfiles=
for lib in $dlfiles; do
case $lib in
*.la)
func_basename "$lib"
name="$func_basename_result"
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
func_fatal_error "\`$lib' is not a valid libtool archive"
newdlfiles="$newdlfiles $libdir/$name"
;;
*) newdlfiles="$newdlfiles $lib" ;;
esac
done
dlfiles="$newdlfiles"
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
*.la)
# Only pass preopened files to the pseudo-archive (for
# eventual linking with the app. that links it) if we
# didn't already link the preopened objects directly into
# the library:
func_basename "$lib"
name="$func_basename_result"
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
func_fatal_error "\`$lib' is not a valid libtool archive"
newdlprefiles="$newdlprefiles $libdir/$name"
;;
esac
done
dlprefiles="$newdlprefiles"
else
newdlfiles=
for lib in $dlfiles; do
case $lib in
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
newdlfiles="$newdlfiles $abs"
done
dlfiles="$newdlfiles"
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
newdlprefiles="$newdlprefiles $abs"
done
dlprefiles="$newdlprefiles"
fi
$RM $output
# place dlname in correct position for cygwin
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
$ECHO > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='$tdlname'
# Names of this library.
library_names='$library_names'
# The name of the static archive.
old_library='$old_library'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags='$new_inherited_linker_flags'
# Libraries that this one depends upon.
dependency_libs='$dependency_libs'
# Names of additional weak libraries provided by this library
weak_library_names='$weak_libs'
# Version information for $libname.
current=$current
age=$age
revision=$revision
# Is this an already installed library?
installed=$installed
# Should we warn about portability when linking against -modules?
shouldnotlink=$module
# Files to dlopen/dlpreopen
dlopen='$dlfiles'
dlpreopen='$dlprefiles'
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
if test "$installed" = no && test "$need_relink" = yes; then
$ECHO >> $output "\
relink_command=\"$relink_command\""
fi
done
}
# Do a symbolic link so that the libtool archive can be found in
# LD_LIBRARY_PATH before the program is installed.
func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
;;
esac
exit $EXIT_SUCCESS
}
{ test "$mode" = link || test "$mode" = relink; } &&
func_mode_link ${1+"$@"}
# func_mode_uninstall arg...
func_mode_uninstall ()
{
$opt_debug
RM="$nonopt"
files=
rmforce=
exit_status=0
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic="$magic"
for arg
do
case $arg in
-f) RM="$RM $arg"; rmforce=yes ;;
-*) RM="$RM $arg" ;;
*) files="$files $arg" ;;
esac
done
test -z "$RM" && \
func_fatal_help "you must specify an RM program"
rmdirs=
origobjdir="$objdir"
for file in $files; do
func_dirname "$file" "" "."
dir="$func_dirname_result"
if test "X$dir" = X.; then
objdir="$origobjdir"
else
objdir="$dir/$origobjdir"
fi
func_basename "$file"
name="$func_basename_result"
test "$mode" = uninstall && objdir="$dir"
# Remember objdir for removal later, being careful to avoid duplicates
if test "$mode" = clean; then
case " $rmdirs " in
*" $objdir "*) ;;
*) rmdirs="$rmdirs $objdir" ;;
esac
fi
# Don't error if the file doesn't exist and rm -f was used.
if { test -L "$file"; } >/dev/null 2>&1 ||
{ test -h "$file"; } >/dev/null 2>&1 ||
test -f "$file"; then
:
elif test -d "$file"; then
exit_status=1
continue
elif test "$rmforce" = yes; then
continue
fi
rmfiles="$file"
case $name in
*.la)
# Possibly a libtool archive, so verify it.
if func_lalib_p "$file"; then
func_source $dir/$name
# Delete the libtool libraries and symlinks.
for n in $library_names; do
rmfiles="$rmfiles $objdir/$n"
done
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
case "$mode" in
clean)
case " $library_names " in
# " " in the beginning catches empty $dlname
*" $dlname "*) ;;
*) rmfiles="$rmfiles $objdir/$dlname" ;;
esac
test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
;;
uninstall)
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
fi
if test -n "$old_library"; then
# Do each command in the old_postuninstall commands.
func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
fi
# FIXME: should reinstall the best remaining shared library.
;;
esac
fi
;;
*.lo)
# Possibly a libtool object, so verify it.
if func_lalib_p "$file"; then
# Read the .lo file
func_source $dir/$name
# Add PIC object to the list of files to remove.
if test -n "$pic_object" &&
test "$pic_object" != none; then
rmfiles="$rmfiles $dir/$pic_object"
fi
# Add non-PIC object to the list of files to remove.
if test -n "$non_pic_object" &&
test "$non_pic_object" != none; then
rmfiles="$rmfiles $dir/$non_pic_object"
fi
fi
;;
*)
if test "$mode" = clean ; then
noexename=$name
case $file in
*.exe)
func_stripname '' '.exe' "$file"
file=$func_stripname_result
func_stripname '' '.exe' "$name"
noexename=$func_stripname_result
# $file with .exe has already been added to rmfiles,
# add $file without .exe
rmfiles="$rmfiles $file"
;;
esac
# Do a test to see if this is a libtool program.
if func_ltwrapper_p "$file"; then
if func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
relink_command=
func_source $func_ltwrapper_scriptname_result
rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
else
relink_command=
func_source $dir/$noexename
fi
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
if test "$fast_install" = yes && test -n "$relink_command"; then
rmfiles="$rmfiles $objdir/lt-$name"
fi
if test "X$noexename" != "X$name" ; then
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
fi
fi
fi
;;
esac
func_show_eval "$RM $rmfiles" 'exit_status=1'
done
objdir="$origobjdir"
# Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do
if test -d "$dir"; then
func_show_eval "rmdir $dir >/dev/null 2>&1"
fi
done
exit $exit_status
}
{ test "$mode" = uninstall || test "$mode" = clean; } &&
func_mode_uninstall ${1+"$@"}
test -z "$mode" && {
help="$generic_help"
func_fatal_help "you must specify a MODE"
}
test -z "$exec_cmd" && \
func_fatal_help "invalid operation mode \`$mode'"
if test -n "$exec_cmd"; then
eval exec "$exec_cmd"
exit $EXIT_FAILURE
fi
exit $exit_status
# The TAGs below are defined such that we never get into a situation
# in which we disable both kinds of libraries. Given conflicting
# choices, we go for a static library, that is the most portable,
# since we can't tell whether shared libraries were disabled because
# the user asked for that or because the platform doesn't support
# them. This is particularly important on AIX, because we don't
# support having both static and shared libraries enabled at the same
# time on that platform, so we default to a shared-only configuration.
# If a disable-shared tag is given, we'll fallback to a static-only
# configuration. But we'll never go from static-only to shared-only.
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
build_libtool_libs=no
build_old_libs=yes
# ### END LIBTOOL TAG CONFIG: disable-shared
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
# ### END LIBTOOL TAG CONFIG: disable-static
# Local Variables:
# mode:shell-script
# sh-indentation:2
# End:
# vi:sw=2
gecko-mediaplayer-1.0.8/gecko-mediaplayer.spec.in 0000664 0001750 0001750 00000003257 11535465414 016707 0000000 0000000 %define ver @VERSION@
%define use_gconf @USE_GCONF@
Name: gecko-mediaplayer
Summary: Multimedia browser plugin for Gecko based browsers
Version: %{ver}
Release: 1%{?dist}
License: GPLv2+
Group: Internet/Multimedia
Packager: Kevin DeKorte
Source0: http://dekorte.homeip.net/download/gecko-mediaplayer/gecko-mediaplayer-%{ver}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: gnome-mplayer
%if 0%{?fedora} > 8
BuildRequires: gcc-c++, pkgconfig, gettext, xulrunner-devel, dbus-devel, dbus-glib-devel, glib2-devel, GConf2-devel, libX11-devel libcurl-devel
%else
BuildRequires: gcc-c++, pkgconfig, gettext, firefox-devel, dbus-devel, dbus-glib-devel, glib2-devel, GConf2-devel, libX11-devel
%endif
%description
Gecko Media Player is a browser plugin that uses GNOME MPlayer to play media in a browser. It should work with all browsers on Unix-ish systems(Linux, BSD, Solaris) and use the NS4 API (Mozilla, Firefox, Opera, etc.). Gecko Media Player is in heavy development, but I wanted to get some code drops out there so that people can start using and testing it.
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
rm -rf %buildroot
make install DESTDIR=%buildroot
%clean
rm -rf $buildroot
%post
update-desktop-database %{_datadir}/applications
%if %{use_gconf}
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
if [ -e %{_sysconfdir}/gconf/schemas/gecko-mediaplayer.schemas ]; then
gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/gecko-mediaplayer.schemas > /dev/null
fi
%endif
%files
%defattr(-,root,root,-)
%{_docdir}/%{name}
%{_libdir}/mozilla
%{_datadir}/locale
%if %{use_gconf}
%config %{_sysconfdir}
%endif
gecko-mediaplayer-1.0.8/DOCS/ 0000775 0001750 0001750 00000000000 12114222537 012634 5 0000000 0000000 gecko-mediaplayer-1.0.8/DOCS/tech/ 0000775 0001750 0001750 00000000000 12114222537 013557 5 0000000 0000000 gecko-mediaplayer-1.0.8/DOCS/tech/javascript.txt 0000644 0001750 0001750 00000010777 10764013206 016420 0000000 0000000 gecko-mediaplayer supports the following javascript methods, properties and events
methods:
void Play();
void PlayAt(in double value);
void Pause();
void Stop();
void quit();
void DoPlay();
void DoPause();
void FastForward();
void FastReverse();
void ff();
void rew();
void rewind();
void Seek(in double value);
void Open(in string filename);
void SetFileName(in string filename);
double getTime();
double getDuration();
double getPercent();
void SetVolume(in double value);
double GetVolume();
void controls.play();
void controls.pause();
void controls.stop();
properties:
attribute string filename;
readonly attribute long playState;
attribute boolean ShowControls;
attribute boolean fullscreen;
attribute boolean showlogo;
boolean isplaying();
events:
onMediaComplete
onMediaCompleteWithError(error)
onEndOfStream
onVisible
onHidden
onDestroy
onClick
onMouseDown(button)
onMouseUp(button)
Detail:
Play(), DoPlay(), controls.play()
plays the current media
PlayAt(value)
plays the current media, starting at value seconds into the media
Pause(), DoPause(), controls.pause()
pauses the playing media
Stop(), controls.stop()
stops the playing media
quit()
cancels the media player triggers onMediaComplete and onEndOfStream events
FastForward(),ff()
Seeks forward 10 seconds in the media
FastReverse(),rew(),rewind()
Seeks backwards 10 seconds in the media
Seek(value)
Seeks "value" seconds into the media
Open(filename),SetFileName()
Opens "filename", but does not start it
getTime()
Returns the number of seconds into the media
getDuration()
Returns the number of seconds the media is long
getPercent()
Gets percentage of media played 0 = 0% 100= 100%
Will return 0 for some media types since duration is not always
available from mplayer
SetVolume(value)
Sets the volume to % value. So setting this to 50 sets the volume to 50% of max
GetVolume()
Returns the percentage of max volume.
filename
Able to get and set this property
x = filename, puts the URL of the current media in x
filename = "x", opens URL x, like Open("x")
isplaying()
Returns true if playState > 1 and < 7
playState
read only property
Possible return values and meanings
UNDEFINED 0
STOPPED 1
PAUSED 2
PLAYING 3
SCANFORWARD 4
SCANREVERSE 5
BUFFERING 6
WAITING 7
MEDIAENDED 8
TRANSITIONING 9
READY 10
RECONNECTING 11
INITIALIZING 12
ShowControls
Boolean property to make the player controls visible or not
fullscreen
Boolean property to make the player go fullscreen or not
showlogo
Boolean property to make the logo visible or not
onMediaComplete, onEndOfStream
Events that are triggered when the playlist is empty
example:
onMediaCompleteWithError(error)
Events that are triggered when the playlist is empty
error is an integer
ERROR_NO_ERROR 0
ERROR_NO_STREAM 1
ERROR_CODEC_FAILURE ERROR_NO_STREAM << 1
ERROR_EXPLICIT_KILL ERROR_NO_STREAM << 2
ERROR_PLAYER_INTERRUPTED ERROR_NO_STREAM << 3
ERROR_EXECV ERROR_NO_STREAM << 4
ERROR_NOT_PLAYLIST ERROR_NO_STREAM << 5
ERROR_FILE_NOT_FOUND ERROR_NO_STREAM << 6
example:
onVisible
Event that is triggered when video media is uncovered by a window, might want to use
with the nopauseonhide embed attribute
onHidden
Event that is triggered when video media is covered by a window, might want to use
with the nopauseonhide embed attribute
onDestroy
Event that is triggered when the embedded mplayerplug-in is destroyed, best used when mplayerplug-in
is in a frame and the frame is destroyed/hidden.
onClick
Event that is triggered when mouse button one is clicked over the plugin.
onMouseDown(button)
Event that is triggered when the mouse button is down over the plugin.
button is an integer that is the button that is down
onMouseUp(button)
Event that is triggered when the mouse button is released over the plugin.
button is an integer that is the button that is down
gecko-mediaplayer-1.0.8/po/ 0000775 0001750 0001750 00000000000 12114222537 012522 5 0000000 0000000 gecko-mediaplayer-1.0.8/po/ja.gmo 0000664 0001750 0001750 00000002110 12113707422 013532 0000000 0000000 Þ• t Ì $ 8 X p w ‡ + – Â X Ù 2 K ' g # ³ À Ç Î I ç 1
Buffering %2.1lf%% Cache fill: %2.2f%% Cache fill: %2.2f%% (%0.1f K/s) Caching %iK (%0.1f K/s) Paused Playing Stopped Unknown Status Write unable to write because item is NULL
gecko mediaplayer v%s
Project-Id-Version: gecko-mediaplayer
Report-Msgid-Bugs-To:
POT-Creation-Date: 2013-02-17 07:39-0700
PO-Revision-Date: 2013-02-20 02:52+0900
Last-Translator: Munehiro Yamamoto
Language-Team: munepi
Language:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
ãƒãƒƒãƒ•ã‚¡ä¸ %2.1lf%% ã‚ャッシュä¸: %2.2f%% ã‚ャッシュä¸: %2.2f%% (%0.1f K/s) ã‚ャッシュä¸: %iK (%0.1f K/s) ä¸€æ™‚åœæ¢ å†ç”Ÿ åœæ¢ 䏿˜Žãªã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ オブジェクト㌠NULL ãªã®ã§æ›¸ã込むã“ã¨ãŒã§ãã¾ã›ã‚“
gecko mediaplayer v%s
gecko-mediaplayer-1.0.8/po/tr.gmo 0000664 0001750 0001750 00000002041 12110165627 013572 0000000 0000000 Þ• t Ì $ 8 X p w ‡ + – Â † Ù ` s † ¥
¿
Ê Ø Þ ï
Buffering %2.1lf%% Cache fill: %2.2f%% Cache fill: %2.2f%% (%0.1f K/s) Caching %iK (%0.1f K/s) Paused Playing Stopped Unknown Status Write unable to write because item is NULL
gecko mediaplayer v%s
Project-Id-Version: tr
Report-Msgid-Bugs-To:
POT-Creation-Date: 2013-02-17 07:39-0700
PO-Revision-Date: 2011-06-13 14:09+0300
Last-Translator: Onur Küçük
Language-Team: Turkish
Language: tr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Generator: Lokalize 1.0
Plural-Forms: nplurals=1; plural=0;
Önbellek %2.1lf%% Önbellek: %2.2f%% Önbellek: %2.2f%% (%0.1f K/s) Önbellek %iK (%0.1f K/s) Durakladı Oynatılıyor Durdu Bilinmeyen Durum NULL içerik yazılamıyor
gecko mediaplayer %s
gecko-mediaplayer-1.0.8/po/nl.po 0000664 0001750 0001750 00000002752 12110165627 013423 0000000 0000000 # Dutch translation of Gecko Media Player.
# Copyright (C) 2007 Kevin DeKorte
# This file is distributed under the same license as the GNOME MPlayer package.
# Kevin DeKorte 2007.
#
#
msgid ""
msgstr ""
"Project-Id-Version: gecko-mediaplayer\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-17 07:39-0700\n"
"PO-Revision-Date: 2011-07-22 13:53+0200\n"
"Last-Translator: Mark Huijgen \n"
"Language-Team: Mark Huijgen \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/plugin.cpp:431
#, c-format
msgid "gecko mediaplayer v%s\n"
msgstr ""
#: src/plugin.cpp:713
#, c-format
msgid "Cache fill: %2.2f%%"
msgstr "Buffer niveau: %2.2f%%"
#: src/plugin.cpp:928
msgid "Write unable to write because item is NULL\n"
msgstr "Schrijven niet mogelijk omdat item NULL is\n"
#: src/plugin.cpp:994 src/plugin.cpp:1411
#, c-format
msgid "Caching %iK (%0.1f K/s)"
msgstr "Bufferen %iK (%0.1f K/s)"
#: src/plugin.cpp:997 src/plugin.cpp:1414
#, c-format
msgid "Cache fill: %2.2f%% (%0.1f K/s)"
msgstr "Buffer niveau: %2.2f%% (%0.1f K/s)"
#: src/plugin.cpp:2622
msgid "Playing"
msgstr "Afspelen"
#: src/plugin.cpp:2625
msgid "Paused"
msgstr "Gepauzeerd"
#: src/plugin.cpp:2628
msgid "Stopped"
msgstr "Gestopt"
#: src/plugin.cpp:2632
#, c-format
msgid "Buffering %2.1lf%%"
msgstr "Bufferen %2.1lf%%"
#: src/plugin.cpp:2637
msgid "Unknown Status"
msgstr "Onbekende status"
gecko-mediaplayer-1.0.8/po/es.gmo 0000664 0001750 0001750 00000002040 12113707422 013551 0000000 0000000 Þ• t Ì $ 8 X p w ‡ + – Â N Ù ( G # _ % ƒ ©
± ¿ È - Û
Buffering %2.1lf%% Cache fill: %2.2f%% Cache fill: %2.2f%% (%0.1f K/s) Caching %iK (%0.1f K/s) Paused Playing Stopped Unknown Status Write unable to write because item is NULL
gecko mediaplayer v%s
Project-Id-Version: Gecko Mediaplayer
Report-Msgid-Bugs-To:
POT-Creation-Date: 2013-02-17 07:39-0700
PO-Revision-Date: 2013-02-21 09:02-0000
Last-Translator: AmatCoder
Language-Team:
Language: es_ES
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=2; plural=(n != 1);
Almacenando en buffer %2.1lf%% Caché ocupado: %2.2f%% Caché ocupado: %2.2f%% (%0.1f K/s) Almacenando en caché %iK (%0.1f K/s) Pausado Reproduciendo Detenido Estado desconocido Escritura imposible porque el objeto es NULL
gecko mediaplayer v%s
gecko-mediaplayer-1.0.8/po/pt_BR.po 0000664 0001750 0001750 00000002725 12110165627 014020 0000000 0000000 # Brazilian Portuguese translation of Gecko MediaPlayer.
# Fábio Antunes, 2007, 2008.
# This file is distributed under the same license as the Gecko MediaPlayer package.
# Copyright (C) Kevin DeKorte 2006-2008
#
msgid ""
msgstr ""
"Project-Id-Version: gecko-mediaplayer 0.9.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-17 07:39-0700\n"
"PO-Revision-Date: 2008-05-31 12:46-0300\n"
"Last-Translator: \n"
"Language-Team: Portugese \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/plugin.cpp:431
#, c-format
msgid "gecko mediaplayer v%s\n"
msgstr ""
#: src/plugin.cpp:713
#, c-format
msgid "Cache fill: %2.2f%%"
msgstr "Armazenando cache: %2.2f%%"
#: src/plugin.cpp:928
#, fuzzy
msgid "Write unable to write because item is NULL\n"
msgstr "Não foi possÃvel escrever porque o item é inválido (NULL)"
#: src/plugin.cpp:994 src/plugin.cpp:1411
#, fuzzy, c-format
msgid "Caching %iK (%0.1f K/s)"
msgstr "Armazenando cache: %2.2f%% (%0.1f K/s)"
#: src/plugin.cpp:997 src/plugin.cpp:1414
#, c-format
msgid "Cache fill: %2.2f%% (%0.1f K/s)"
msgstr "Armazenando cache: %2.2f%% (%0.1f K/s)"
#: src/plugin.cpp:2622
msgid "Playing"
msgstr ""
#: src/plugin.cpp:2625
msgid "Paused"
msgstr ""
#: src/plugin.cpp:2628
msgid "Stopped"
msgstr ""
#: src/plugin.cpp:2632
#, c-format
msgid "Buffering %2.1lf%%"
msgstr ""
#: src/plugin.cpp:2637
msgid "Unknown Status"
msgstr ""
gecko-mediaplayer-1.0.8/po/pt_BR.gmo 0000664 0001750 0001750 00000001010 12110165627 014146 0000000 0000000 Þ• 4 L ` a u 0 • Æ &