CVSROOT: /sources/gnash Module name: gnash Changes by: Rob Savoye <rsavoye> 08/02/01 01:30:30
Modified files: . : configure.ac ChangeLog server/asobj : LocalConnection.h LocalConnection.cpp server/vm : ASHandlers.cpp libbase : shm.cpp utilities : dumpshm.cpp macros : ffmpeg.m4 gettext.m4 glib.m4 incllist qt.m4 qtopia.m4 Log message: * configure.ac: Add test for IPC_INFO, which isn't portable to BSD. * server/asobj/LocalConnection.cpp: Don;t define any LC constants here, they're in libamf.lcshm.cpp now instead. Add flag for whether we are connected or not. * server/asobj/LocalConnection.h: Use LcShm class instead of Shm as a base class for shared memory. * server/vm/ASHandlers.cpp: Include unistd.h so write() is defined on BSD. * libbase/shm.cpp: BSD wants 0 cast to key_t. * utilities/dumpshm.cpp: Only look for the key if IPC_INFO exists, as we can't find the key without if for now. Optionally write the output to stdout. * macros/qt.m4: Also look in ${QTDIR}/bin. * macros/incllist: Look inm /usr/pkg on BSD, not /pkg/. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/configure.ac?cvsroot=gnash&r1=1.477&r2=1.478 http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5542&r2=1.5543 http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/LocalConnection.h?cvsroot=gnash&r1=1.14&r2=1.15 http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/LocalConnection.cpp?cvsroot=gnash&r1=1.21&r2=1.22 http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.190&r2=1.191 http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/shm.cpp?cvsroot=gnash&r1=1.3&r2=1.4 http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/dumpshm.cpp?cvsroot=gnash&r1=1.22&r2=1.23 http://cvs.savannah.gnu.org/viewcvs/gnash/macros/ffmpeg.m4?cvsroot=gnash&r1=1.52&r2=1.53 http://cvs.savannah.gnu.org/viewcvs/gnash/macros/gettext.m4?cvsroot=gnash&r1=1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/gnash/macros/glib.m4?cvsroot=gnash&r1=1.31&r2=1.32 http://cvs.savannah.gnu.org/viewcvs/gnash/macros/incllist?cvsroot=gnash&r1=1.6&r2=1.7 http://cvs.savannah.gnu.org/viewcvs/gnash/macros/qt.m4?cvsroot=gnash&r1=1.4&r2=1.5 http://cvs.savannah.gnu.org/viewcvs/gnash/macros/qtopia.m4?cvsroot=gnash&r1=1.7&r2=1.8 Patches: Index: configure.ac =================================================================== RCS file: /sources/gnash/gnash/configure.ac,v retrieving revision 1.477 retrieving revision 1.478 diff -u -b -r1.477 -r1.478 --- configure.ac 27 Jan 2008 07:18:16 -0000 1.477 +++ configure.ac 1 Feb 2008 01:30:27 -0000 1.478 @@ -250,6 +250,11 @@ if test x"${with_shm}" = x"sysv"; then AC_DEFINE([USE_SYSV_SHM], [1], [Use SYSV shared memory for compatability]) + dnl IPC_INFO isn't portable, and doesn't exist on BSD + AC_TRY_COMPILE([#include <sys/ipc.h> #include <sys/shm.h>], [ + int flag = IPC_INFO; ], + AC_DEFINE([HAVE_IPC_INFO], [1], [Use shm_info]) + ) else AC_DEFINE([USE_POSIX_SHM], [1], [Use POSIX shared memory]) fi Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.5542 retrieving revision 1.5543 diff -u -b -r1.5542 -r1.5543 --- ChangeLog 31 Jan 2008 21:38:40 -0000 1.5542 +++ ChangeLog 1 Feb 2008 01:30:28 -0000 1.5543 @@ -1,3 +1,21 @@ +2008-01-31 Rob Savoye <[EMAIL PROTECTED]> + + * configure.ac: Add test for IPC_INFO, which isn't portable to + BSD. + * server/asobj/LocalConnection.cpp: Don;t define any LC constants + here, they're in libamf.lcshm.cpp now instead. Add flag for + whether we are connected or not. + * server/asobj/LocalConnection.h: Use LcShm class instead of Shm + as a base class for shared memory. + * server/vm/ASHandlers.cpp: Include unistd.h so write() is defined + on BSD. + * libbase/shm.cpp: BSD wants 0 cast to key_t. + * utilities/dumpshm.cpp: Only look for the key if IPC_INFO exists, + as we can't find the key without if for now. Optionally write the + output to stdout. + * macros/qt.m4: Also look in ${QTDIR}/bin. + * macros/incllist: Look inm /usr/pkg on BSD, not /pkg/. + 2008-01-31 Sandro Santilli <[EMAIL PROTECTED]> * libbase/URL.cpp: don't threat ".swf" strings as any special. Index: server/asobj/LocalConnection.h =================================================================== RCS file: /sources/gnash/gnash/server/asobj/LocalConnection.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -b -r1.14 -r1.15 --- server/asobj/LocalConnection.h 21 Jan 2008 20:55:56 -0000 1.14 +++ server/asobj/LocalConnection.h 1 Feb 2008 01:30:29 -0000 1.15 @@ -28,35 +28,32 @@ #include "as_object.h" // for inheritance #include "fn_call.h" -#include "shm.h" +#include "lcshm.h" namespace gnash { -class LocalConnection : public as_object, Shm { +class LocalConnection : public as_object, LcShm { public: LocalConnection(); ~LocalConnection(); void close(void); + bool connect(); bool connect(const std::string& name); std::string domain(int version); void send(); + std::string &getName() { return _name; }; + bool connected() { return _connected; }; + // FIXME: these should be callbacks // bool _allowDomain; // bool _allowInsecureDomain; // bool _onStatus; private: + bool _connected; std::string _name; std::map<const char *, short> _allocated; }; -#if 0 -class localconnection_as_object : public as_object -{ -public: - LocalConnection obj; -}; -#endif - as_value localconnection_new(const fn_call& fn); as_value localconnection_close(const fn_call& fn); as_value localconnection_connect(const fn_call& fn); Index: server/asobj/LocalConnection.cpp =================================================================== RCS file: /sources/gnash/gnash/server/asobj/LocalConnection.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -b -r1.21 -r1.22 --- server/asobj/LocalConnection.cpp 29 Jan 2008 14:52:18 -0000 1.21 +++ server/asobj/LocalConnection.cpp 1 Feb 2008 01:30:29 -0000 1.22 @@ -74,11 +74,6 @@ namespace gnash { -// The maximum -const int LC_HEADER_SIZE = 16; -const int MAX_LC_HEADER_SIZE = 40960; -const int LC_LISTENERS_START = MAX_LC_HEADER_SIZE + LC_HEADER_SIZE; - // This doesn't exist on all systems, but here's the vaue used on Unix. #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 64 @@ -89,6 +84,7 @@ /// each other Flash Objects to be executed. /// LocalConnection::LocalConnection() + : _connected(false) { GNASH_REPORT_FUNCTION; } @@ -115,23 +111,35 @@ /// send() command to signify which local connection to send the /// object to. bool +LocalConnection::connect() +{ + return connect(""); +} + +bool LocalConnection::connect(const std::string& name) { GNASH_REPORT_FUNCTION; + if (name.empty()) { + _name = "none, sysv segment type"; + } else { _name = name; + } - log_debug("trying to open shared memory segment: \"%s\"", name.c_str()); + log_debug("trying to open shared memory segment: \"%s\"", _name.c_str()); - if (Shm::attach(name.c_str(), true) == false) { + if (Shm::attach(_name.c_str(), true) == false) { return false; } if (Shm::getAddr() <= 0) { - log_error("Failed to open shared memory segment: \"%s\"", name.c_str()); + log_error("Failed to open shared memory segment: \"%s\"", _name.c_str()); return false; } + _connected = true; + return true; } @@ -188,7 +196,7 @@ as_value localconnection_new(const fn_call& /* fn */) { -// GNASH_REPORT_FUNCTION; + GNASH_REPORT_FUNCTION; LocalConnection *localconnection_obj = new LocalConnection; localconnection_obj->init_member("close", new builtin_function(localconnection_close)); @@ -247,12 +255,19 @@ as_value localconnection_send(const fn_call& fn) { - boost::intrusive_ptr<LocalConnection> obj = ensureType<LocalConnection>(fn.this_ptr); + GNASH_REPORT_FUNCTION; + boost::intrusive_ptr<LocalConnection> ptr = ensureType<LocalConnection>(fn.this_ptr); + + if (!ptr->connected()) { + ptr->connect(); + } + if (rcfile.getLocalConnection() ) { log_security("Attempting to write to disabled LocalConnection!"); return as_value(false); } + // FIXME: send something return as_value(); } Index: server/vm/ASHandlers.cpp =================================================================== RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v retrieving revision 1.190 retrieving revision 1.191 diff -u -b -r1.190 -r1.191 --- server/vm/ASHandlers.cpp 30 Jan 2008 23:32:58 -0000 1.190 +++ server/vm/ASHandlers.cpp 1 Feb 2008 01:30:29 -0000 1.191 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: ASHandlers.cpp,v 1.190 2008/01/30 23:32:58 strk Exp $ */ +/* $Id: ASHandlers.cpp,v 1.191 2008/02/01 01:30:29 rsavoye Exp $ */ #ifdef HAVE_CONFIG_H #include "gnashconfig.h" @@ -50,6 +50,7 @@ #include "sound_handler.h" #include "namedStrings.h" +#include <unistd.h> #include <string> #include <map> #include <set> Index: libbase/shm.cpp =================================================================== RCS file: /sources/gnash/gnash/libbase/shm.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- libbase/shm.cpp 25 Jan 2008 18:07:59 -0000 1.3 +++ libbase/shm.cpp 1 Feb 2008 01:30:29 -0000 1.4 @@ -80,7 +80,7 @@ Shm::attach() { // GNASH_REPORT_FUNCTION; - return attach(0, false); + return attach(static_cast<key_t>(0), false); } bool Index: utilities/dumpshm.cpp =================================================================== RCS file: /sources/gnash/gnash/utilities/dumpshm.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -b -r1.22 -r1.23 --- utilities/dumpshm.cpp 25 Jan 2008 18:48:30 -0000 1.22 +++ utilities/dumpshm.cpp 1 Feb 2008 01:30:30 -0000 1.23 @@ -73,9 +73,11 @@ using namespace std; using namespace gnash; +// #error "No supported shared memory type for this platform" + static void usage (void); void dump_ctrl(void *ptr); -void dump_shm(bool convert); +void dump_shm(bool convert, bool out); key_t list_lcs(); const int PIDSTART = 20000; @@ -180,14 +182,27 @@ exit(0); } +#if defined(USE_SYSV_SHM) && defined(HAVE_IPC_INFO) // Just list the shared memory segments if (listfiles && sysv) { list_lcs(); exit(0); } +#endif + + if (optind <= argc - 1) { + if (*argv[optind] == '-') { + filespec = '-'; + } + } if (sysv) { - dump_shm(convert); + if (filespec == "-") { + dump_shm(convert, true); + } else { + dump_shm(convert, false); + } + exit(0); } @@ -198,9 +213,11 @@ // get the file name from the command line if (optind < argc) { filespec = argv[optind]; + if (!convert) { cout << "Will use \"" << filespec << "\" for memory segment file" << endl; } + } DIR *library_dir = NULL; @@ -319,7 +336,7 @@ // Dump the older style SYS V shared memory segments void -dump_shm(bool convert) +dump_shm(bool convert, bool out) { // These are here for debugging purposes. It int id; @@ -329,7 +346,9 @@ if (key == 0) { cerr << "No LcShmKey set in ~/.gnashrc, trying to find it ourselves" << endl; +#if defined(USE_SYSV_SHM) && defined(HAVE_IPC_INFO) key = list_lcs(); +#endif } if (key == 0) { @@ -344,8 +363,6 @@ LcShm lc; lc.connect(key); - auto_ptr< vector<string> > listeners ( lc.listListeners() ); - cout << "There are " << listeners->size() << " Listeners listening" << endl; lc.dump(); // If the -c convert options was specified, dump the memory segment to disk. @@ -356,39 +373,50 @@ perror("open"); } cout << "Writing memory segment to disk: \"segment.raw\"" << endl; + shmaddr = lc.getAddr(); write(fd, shmaddr, size); + if (out) { +#if 0 + boost::uint8_t *hexint; + hexint = new boost::uint8_t[(size + 3) *3]; + hexify((boost::uint8_t *)hexint, (uint8_t *)shmaddr, size, false); + log_msg(_("The data is: 0x%s"), hexint); +#endif + } + close(fd); } exit (0); } +#if defined(USE_SYSV_SHM) && defined(HAVE_IPC_INFO) key_t list_lcs() { int maxid, shmid, id; struct shmid_ds shmseg; - struct shm_info shm_info; struct shminfo shminfo; -#ifdef USE_POSIX_SHM - if (library_dir != NULL) { - for (i=0; entry>0; i++) { - entry = readdir(library_dir); - if (entry != NULL) { - cout << "Found segment: " << entry->d_name << endl; - } - } - } else { - cout << _("Sorry, we can only list the files on systems with" - " disk based shared memory") << endl; - } -#else +// #ifdef USE_POSIX_SHM +// if (library_dir != NULL) { +// for (i=0; entry>0; i++) { +// entry = readdir(library_dir); +// if (entry != NULL) { +// cout << "Found segment: " << entry->d_name << endl; +// } +// } +// } else { +// cout << _("Sorry, we can only list the files on systems with" +// " disk based shared memory") << endl; +// } +// #eendif + // If we're using SYSV shared memory, we can get a list of shared memory segments. // By examing the size of each one, we can make a reasonable guess if it's one // used for flash. As permissions apply, this will only list the segments created // by the user running dumpshm. -#ifdef USE_SYSV_SHM + struct shm_info shm_info; maxid = shmctl(0, SHM_INFO, (struct shmid_ds *) (void *) &shm_info); if (maxid < 0) { cerr << "kernel not configured for shared memory"; @@ -398,7 +426,6 @@ if ((shmctl(0, IPC_INFO, (struct shmid_ds *) (void *) &shminfo)) < 0) { return 0; } - for (id = 0; id <= maxid; id++) { shmid = shmctl(id, SHM_STAT, &shmseg); if (shmid < 0) { @@ -414,15 +441,16 @@ cout << "Last detached on: " << ctime(&shmseg.shm_dtime); return shmseg.shm_perm.__key; } -#endif +#endif // end of IPC_PERM_KEY } -#else -#error "No supported shared memory type for this platform" -#endif -#endif +// #else +// # error "No supported shared memory type for this platform" +//#endif // end of USE_POSIX_SHM + // Didn't find any segments of the right size - return 0; + return reinterpret_cast<key_t>(0); } +#endif // end of USE_SYSV_SHM & HAVE_IPC_INFO /// \brief Display the command line arguments static void Index: macros/ffmpeg.m4 =================================================================== RCS file: /sources/gnash/gnash/macros/ffmpeg.m4,v retrieving revision 1.52 retrieving revision 1.53 diff -u -b -r1.52 -r1.53 --- macros/ffmpeg.m4 13 Oct 2007 23:24:07 -0000 1.52 +++ macros/ffmpeg.m4 1 Feb 2008 01:30:30 -0000 1.53 @@ -14,7 +14,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -dnl $Id: ffmpeg.m4,v 1.52 2007/10/13 23:24:07 rsavoye Exp $ +dnl $Id: ffmpeg.m4,v 1.53 2008/02/01 01:30:30 rsavoye Exp $ AC_DEFUN([GNASH_PATH_FFMPEG], [ @@ -375,6 +375,9 @@ else libgsm="" fi + + dnl OpenBSD seems to have a problem with libgsm. + if test x$openbsd_os != xopenbsd; then if test x"${libgsm}" = x; then if test -f ${topdir}/libgsm.a -o -f ${topdir}/libgsm.${shlibext}; then ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lgsm" @@ -385,6 +388,7 @@ AC_CHECK_LIB(gsm, gsm_destroy, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lgsm"]) fi fi + fi else AC_MSG_RESULT(${libgsm}) ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libgsm}" Index: macros/gettext.m4 =================================================================== RCS file: /sources/gnash/gnash/macros/gettext.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- macros/gettext.m4 6 Apr 2007 07:49:55 -0000 1.1 +++ macros/gettext.m4 1 Feb 2008 01:30:30 -0000 1.2 @@ -342,8 +342,13 @@ AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) - dnl For backward compatibility. Some Makefiles may be using this. + dnl For backward compatibility. Some Makefiles may be using this. OpenBSD + dnl appears to use $LTLIBINTL instead of "$LIBINTL". + if test x$LTLIBINTL != x; then + INTLLIBS="$LIBINTL $LTLIBINTL" + else INTLLIBS="$LIBINTL" + fi AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. Index: macros/glib.m4 =================================================================== RCS file: /sources/gnash/gnash/macros/glib.m4,v retrieving revision 1.31 retrieving revision 1.32 diff -u -b -r1.31 -r1.32 --- macros/glib.m4 23 Oct 2007 21:34:36 -0000 1.31 +++ macros/glib.m4 1 Feb 2008 01:30:30 -0000 1.32 @@ -14,7 +14,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -dnl $Id: glib.m4,v 1.31 2007/10/23 21:34:36 nihilus Exp $ +dnl $Id: glib.m4,v 1.32 2008/02/01 01:30:30 rsavoye Exp $ AC_DEFUN([GNASH_PATH_GLIB], [ @@ -89,7 +89,7 @@ if test x"${ac_cv_path_glib_lib}" = x; then for i in $libslist; do if test -f $i/libglib-${gnash_glib_version}.a -o -f $i/libglib-${gnash_glib_version}.${shlibext}; then - if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then + if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64" -a ! x"$i" = x"/usr"; then ac_cv_path_glib_lib="-L$i -lglib-${gnash_glib_version}" break else Index: macros/incllist =================================================================== RCS file: /sources/gnash/gnash/macros/incllist,v retrieving revision 1.6 retrieving revision 1.7 diff -u -b -r1.6 -r1.7 --- macros/incllist 28 Apr 2007 00:04:26 -0000 1.6 +++ macros/incllist 1 Feb 2008 01:30:30 -0000 1.7 @@ -1 +1 @@ -${with_top_level}/include ${prefix}/${host_alias}/include ${prefix}/include /sw/include /usr/nekoware/include /usr/freeware/include /pkg/include /opt/local/include /usr/local/include /home/latest/include /opt/include /opt/mesa/include /opt/include /usr/X11R6/include /usr/X11/include /usr/include /usr/pkg/include /usr/local/olpc/include .. ../.. +${with_top_level}/include ${prefix}/${host_alias}/include ${prefix}/include /sw/include /usr/nekoware/include /usr/freeware/include /usr/pkg/include /opt/local/include /usr/local/include /home/latest/include /opt/include /opt/mesa/include /opt/include /usr/X11R6/include /usr/X11/include /usr/include /usr/pkg/include /usr/local/olpc/include .. ../.. Index: macros/qt.m4 =================================================================== RCS file: /sources/gnash/gnash/macros/qt.m4,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- macros/qt.m4 26 Jan 2008 01:24:28 -0000 1.4 +++ macros/qt.m4 1 Feb 2008 01:30:30 -0000 1.5 @@ -205,7 +205,7 @@ has_qt="no" fi - AC_PATH_PROG(MOC, moc, ,[${gnash_qt_topdir}/bin ${pathlist}]) + AC_PATH_PROG(MOC, moc, ,[${QTDIR}/bin ${gnash_qt_topdir}/bin ${pathlist}]) AC_SUBST(MOC) Index: macros/qtopia.m4 =================================================================== RCS file: /sources/gnash/gnash/macros/qtopia.m4,v retrieving revision 1.7 retrieving revision 1.8 diff -u -b -r1.7 -r1.8 --- macros/qtopia.m4 29 Nov 2007 05:14:55 -0000 1.7 +++ macros/qtopia.m4 1 Feb 2008 01:30:30 -0000 1.8 @@ -14,7 +14,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -dnl $Id: qtopia.m4,v 1.7 2007/11/29 05:14:55 rsavoye Exp $ +dnl $Id: qtopia.m4,v 1.8 2008/02/01 01:30:30 rsavoye Exp $ dnl [EMAIL PROTECTED] pts/8> QtCore QtSvg Qtnetwork QtXml dnl QtCore: Command not found. @@ -26,6 +26,7 @@ has_qtopia=no gnash_qtopia_version=0 + dnl the list of Qtopia headers we need dnl Look for the header AC_ARG_WITH(qtopia, AC_HELP_STRING([--with-qtopia], [directory where Qtopia is installed]), with_qtopia=${withval}) _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit