From: <suc...@us...> - 2006-07-28 02:16:45
|
Revision: 137 Author: sucknblow Date: 2006-07-27 19:16:31 -0700 (Thu, 27 Jul 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=137&view=rev Log Message: ----------- Javascript engine is now an optional dependency * Gives a warning if the engine is not found * Should really remove the options from the UI where such features aren't present (TODO) Use internal getopt if the platform doesn't provide it: * Now compiles on OS X. Modified Paths: -------------- trunk/AUTHORS trunk/configure.in trunk/doc/roadmap.txt trunk/frontend/easypmp/cui/Makefile.am trunk/lib/playlist/Makefile.am trunk/lib/playlist/playlist.c trunk/m4/smjs.m4 Modified: trunk/AUTHORS =================================================================== --- trunk/AUTHORS 2006-07-28 01:40:13 UTC (rev 136) +++ trunk/AUTHORS 2006-07-28 02:16:31 UTC (rev 137) @@ -1 +1,2 @@ -Nyaochi +Nyaochi <ny...@ny...> +Martin Ellis <mar...@kd...> Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2006-07-28 01:40:13 UTC (rev 136) +++ trunk/configure.in 2006-07-28 02:16:31 UTC (rev 137) @@ -28,7 +28,7 @@ dnl Initialization for automake dnl ------------------------------------------------------------------ AM_INIT_AUTOMAKE(pmplib, 0.11) -AM_CONFIG_HEADER(config.h) +AC_CONFIG_HEADERS(config.h) AM_MAINTAINER_MODE AM_C_PROTOTYPES @@ -201,9 +201,24 @@ AC_SUBST(JS_CFLAGS) AC_SUBST(JS_LIBS) +AM_CONDITIONAL(have_jsapi, test -n "$JS_CFLAGS") +AM_CONDITIONAL(have_getopt, test "$ac_cv_header_getopt_h" = "yes") dnl ------------------------------------------------------------------ dnl Output the configure results. dnl ------------------------------------------------------------------ AC_CONFIG_FILES(Makefile m4/Makefile lib/ucs2/Makefile lib/filepath/Makefile lib/gmi/Makefile lib/pmp/Makefile lib/pmp_irivnavi/Makefile lib/pmp_portalplayer1/Makefile lib/pmp_iriverplus2/Makefile lib/playlist/Makefile frontend/easypmp/cui/Makefile) + +if test -n "$JS_CFLAGS" ; then + AC_DEFINE([HAVE_JSAPI_H], 1, [Define if you have the jsapi.h header]) +fi + AC_OUTPUT + +if test -z "$JS_CFLAGS" ; then + if test "$enable_js" != no ; then + echo + echo " Warning: JavaScript interpreter engine not found" + fi + echo " pmplib will be build without support for JavaScript playlists." +fi Modified: trunk/doc/roadmap.txt =================================================================== --- trunk/doc/roadmap.txt 2006-07-28 01:40:13 UTC (rev 136) +++ trunk/doc/roadmap.txt 2006-07-28 02:16:31 UTC (rev 137) @@ -16,8 +16,6 @@ - Write documents (build instruction, usage, programing interface, etc.) Long-term plan -- Make the JavaScript engine an optional dependency (it's terrible trying - to build easypmp without pre-built packages of this) - Analyze database format (4th generation) used in iriver E10. Implement database reader/writer for iriver E10. - Support tuner preset conversion. Modified: trunk/frontend/easypmp/cui/Makefile.am =================================================================== --- trunk/frontend/easypmp/cui/Makefile.am 2006-07-28 01:40:13 UTC (rev 136) +++ trunk/frontend/easypmp/cui/Makefile.am 2006-07-28 02:16:31 UTC (rev 137) @@ -4,6 +4,10 @@ man_MANS = easypmp.1 EXTRA_DIST = ${man_MANS} getopt.c getopt1.c +if !have_getopt + getopt = getopt.c getopt1.c +endif + easypmp_SOURCES = \ ../common/easypmp.h \ ../common/database.c \ @@ -13,6 +17,7 @@ option.c \ option.h \ getopt.h \ + $(getopt) \ util.c \ util.h \ main.c Modified: trunk/lib/playlist/Makefile.am =================================================================== --- trunk/lib/playlist/Makefile.am 2006-07-28 01:40:13 UTC (rev 136) +++ trunk/lib/playlist/Makefile.am 2006-07-28 02:16:31 UTC (rev 137) @@ -1,12 +1,17 @@ # $Id$ -jspldir = $(prefix)/share/@PACKAGE@/jspl -jspl_DATA = \ +if have_jsapi + jspl_files = \ jspl/playlist.js \ jspl/artist.jspl \ jspl/artists.jspl \ jspl/top_ranking.jspl + jspl_c = jspl.c + jspldir = $(prefix)/share/@PACKAGE@/jspl + jspl_DATA = $(jspl_files) +endif + lib_LTLIBRARIES = libpmpplaylist.la libpmpplaylist_la_SOURCES = \ @@ -14,7 +19,7 @@ rw_m3u.c \ rw_pls.c \ playlist.c \ - jspl.c + $(jspl_c) libpmpplaylist_la_CPPFLAGS = $(JS_CFLAGS) -DJS_THREADSAFE Modified: trunk/lib/playlist/playlist.c =================================================================== --- trunk/lib/playlist/playlist.c 2006-07-28 01:40:13 UTC (rev 136) +++ trunk/lib/playlist/playlist.c 2006-07-28 02:16:31 UTC (rev 137) @@ -40,10 +40,15 @@ static const ucs2char_t ucs2cs_m3u[] = {'.','m','3','u',0}; static const ucs2char_t ucs2cs_m3u8[] = {'.','m','3','u','8',0}; static const ucs2char_t ucs2cs_pls[] = {'.','p','l','s',0}; + +#ifdef HAVE_JSAPI_H static const ucs2char_t ucs2cs_jspl[] = {'.','j','s','p','l',0}; +#endif/*HAVE_JSAPI_H*/ int playlist_m3u_read(playlists_t* pls, const ucs2char_t *filename, int is_utf8); int playlist_pls_read(playlists_t* pls, const ucs2char_t *filename); + +#ifdef HAVE_JSAPI_H int playlist_jspl_read( playlists_t* pls, const ucs2char_t *filename, @@ -53,6 +58,7 @@ playlist_callback_t callback, void *instance ); +#endif/*HAVE_JSAPI_H*/ void playlist_init(playlists_t* pls) { @@ -84,8 +90,10 @@ return playlist_m3u_read(pls, filename, 1); } else if (filepath_hasext(filename, ucs2cs_pls)) { return playlist_pls_read(pls, filename); +#ifdef HAVE_JSAPI_H } else if (records && filepath_hasext(filename, ucs2cs_jspl)) { return playlist_jspl_read(pls, filename, path_to_include, records, num_records, callback, instance); +#endif/*HAVE_JSAPI_H*/ } else { return -1; } @@ -138,9 +146,13 @@ ret |= filepath_hasext(filename, ucs2cs_m3u); ret |= filepath_hasext(filename, ucs2cs_m3u8); ret |= filepath_hasext(filename, ucs2cs_pls); + +#ifdef HAVE_JSAPI_H if (flag & PLAYLIST_JSPL) { ret |= filepath_hasext(filename, ucs2cs_jspl); } +#endif/*HAVE_JSAPI_H*/ + return ret; } Modified: trunk/m4/smjs.m4 =================================================================== --- trunk/m4/smjs.m4 2006-07-28 01:40:13 UTC (rev 136) +++ trunk/m4/smjs.m4 2006-07-28 02:16:31 UTC (rev 137) @@ -35,22 +35,8 @@ [#define XP_UNIX]) ]) -AC_DEFUN([AC_PATH_SPIDERMONKEY], - [AC_ARG_WITH([spidermonkey], - [AS_HELP_STRING([--with-spidermonkey],[prefix where libjs/libsmjs is installed (optional)])], - [JS_CFLAGS="-I$withval"], [JS_CFLAGS='']) - - AC_ARG_ENABLE([libjs], - [AS_HELP_STRING([--disable-libjs],[don't look for libjs/libsmjs])]) - AC_ARG_ENABLE([mozjs], - [AS_HELP_STRING([--disable-mozjs],[don't look for Mozilla libmozjs])]) - AC_ARG_ENABLE([ffjs], - [AS_HELP_STRING([--disable-ffjs], [don't look for Firefox libmozjs])]) - - test "$enable_libjs$enable_mozjs$enable_ffjs" = "nonono" && - AC_MSG_ERROR([cannot search for no JS library - try removing a --disable-*js option]) - - if test x"$JS_CFLAGS" = x; then +m4_define([spidermonkey_checkall], + [if test x"$JS_CFLAGS" = x; then AC_MSG_NOTICE([looking for the Spidermonkey Javascript library in various places.]) # Try libsmjs/libjs @@ -114,7 +100,7 @@ # Failed... if test x"$JS_CFLAGS" = x; then - AC_MSG_ERROR([libjs not found]) + AC_MSG_WARN([libjs not found]) fi else saved_CFLAGS="$CFLAGS" @@ -132,10 +118,33 @@ JS_LIBS="`spidermonkey_locate_lib([$JS_LIBS])`js" AC_DEFINE(HAVE_LIBSMJS, 1, [Define if you have jsapi.h]) ], - [AC_MSG_ERROR([libjs not found])], + [AC_MSG_WARN([libjs not found])], [#define XP_UNIX]) CFLAGS="$saved_CFLAGS" fi AC_SUBST(JS_CFLAGS) AC_SUBST(JS_LIBS) +]) + +AC_DEFUN([AC_PATH_SPIDERMONKEY], + [AC_ARG_WITH([spidermonkey], + [AS_HELP_STRING([--with-spidermonkey],[prefix where libjs/libsmjs is installed (optional)])], + [JS_CFLAGS="-I$withval"], [JS_CFLAGS='']) + + AC_ARG_ENABLE([js], + [AS_HELP_STRING([--disable-js], [don't build Javascript playlist support])]) + AC_ARG_ENABLE([libjs], + [AS_HELP_STRING([--disable-libjs],[don't look for libjs/libsmjs])]) + AC_ARG_ENABLE([mozjs], + [AS_HELP_STRING([--disable-mozjs],[don't look for Mozilla libmozjs])]) + AC_ARG_ENABLE([ffjs], + [AS_HELP_STRING([--disable-ffjs], [don't look for Firefox libmozjs])]) + +dnl test "$enable_libjs$enable_mozjs$enable_ffjs" = "nonono" && +dnl AC_MSG_ERROR([cannot search for no JS library - try removing a --disable-*js option]) + + if test "$enable_js" != "no" ; then + spidermonkey_checkall + fi + ]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |