From: <ny...@us...> - 2006-06-02 17:45:08
|
Revision: 19 Author: nyaochi Date: 2006-06-02 10:44:51 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=19&view=rev Log Message: ----------- More patch from Martin Ellis (and modified a little by me) for Linux support. It's not tested yet. Modified Paths: -------------- trunk/configure.in trunk/lib/pmp/Makefile.am trunk/lib/pmp/pmp_posix.c trunk/lib/pmp_iriverplus2/Makefile.am trunk/lib/pmp_irivnavi/Makefile.am trunk/lib/pmp_portalplayer1/Makefile.am Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2006-06-02 00:08:40 UTC (rev 18) +++ trunk/configure.in 2006-06-02 17:44:51 UTC (rev 19) @@ -20,7 +20,7 @@ AC_ISC_POSIX dnl Initialization for automake -AM_INIT_AUTOMAKE(pmplib, 0.6) +AM_INIT_AUTOMAKE(pmplib, 0.11) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AM_C_PROTOTYPES @@ -33,6 +33,7 @@ dnl Initialozation for libtool AC_PROG_LIBTOOL +AC_LIBTOOL_DLOPEN dnl Initialization for variables CFLAGS="${ac_save_CFLAGS}" @@ -97,7 +98,17 @@ typedef A_UINT32_T uint32_t; #endif]) +dnl Checks for debugging mode +AC_ARG_ENABLE( + debug, + [AC_HELP_STRING(--enable-debug, [Turn on debugging])] +) +if test "$enable_debug" = "yes"; then + CFLAGS="-DDEBUG -O -g ${CFLAGS}" +fi + + dnl Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_MEMCMP @@ -112,16 +123,16 @@ dnl Check for iconv library AC_ARG_WITH( - iconv-header, - [AC_HELP_STRING(--with-iconv-header=DIR, [iconv header directory])], - [CFLAGS="-I$withval ${CFLAGS}"] + iconv-header, + [AC_HELP_STRING(--with-iconv-header=DIR, [iconv header directory])], + [CFLAGS="-I$withval ${CFLAGS}"] ) AC_ARG_WITH( - iconv-library, - [AC_HELP_STRING(--with-iconv-library=DIR, [iconv library directory])], - [LDFLAGS="-L$withval ${LDFLAGS}"; with_libiconv=native], - [with_libiconv=maybe] + iconv-library, + [AC_HELP_STRING(--with-iconv-library=DIR, [iconv library directory])], + [LDFLAGS="-L$withval ${LDFLAGS}"; with_libiconv=native], + [with_libiconv=maybe] ) AC_CHECK_HEADER(iconv.h, , [AC_MSG_ERROR(iconv.h not found!)]) @@ -161,14 +172,14 @@ esac if test "x$found_iconv" = "xno" ; then - AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv]) + AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv]) fi if test x$with_libiconv != xno ; then - case " $INTLLIBS " in - *[[\ \ ]]-liconv[[\ \ ]]*) ;; - *) ICONV_LIBS="-liconv" ;; - esac + case " $INTLLIBS " in + *[[\ \ ]]-liconv[[\ \ ]]*) ;; + *) ICONV_LIBS="-liconv" ;; + esac fi case $with_libiconv in @@ -183,38 +194,46 @@ dnl Checks for id3tag AC_ARG_WITH( - id3tag-header, - [AC_HELP_STRING(--with-id3tag-header=DIR, [id3tag header directory])], - [CFLAGS="-I$withval ${CFLAGS}"] + id3tag-header, + [AC_HELP_STRING(--with-id3tag-header=DIR, [id3tag header directory])], + [CFLAGS="-I$withval ${CFLAGS}"] ) AC_ARG_WITH( - id3tag-library, - [AC_HELP_STRING(--with-id3tag-library=DIR, [id3tag library directory])], - [LDFLAGS="-L$withval ${LDFLAGS}"] + id3tag-library, + [AC_HELP_STRING(--with-id3tag-library=DIR, [id3tag library directory])], + [LDFLAGS="-L$withval ${LDFLAGS}"] ) AC_CHECK_HEADER( - id3tag.h, - , - [AC_MSG_ERROR(id3tag header not found!)] + id3tag.h, + , + [AC_MSG_ERROR(id3tag header not found!)] ) AC_CHECK_LIB( - id3tag, - id3_file_fdopen, - [ID3TAG_LIBS="-lid3tag"], - AC_MSG_ERROR([id3tag library is not found!]) + id3tag, + id3_file_fdopen, + [ID3TAG_LIBS="-lid3tag"], + AC_MSG_ERROR([id3tag library is not found!]) ) -AC_CHECK_LIB( - id3tag, - id3_file_gettag, - [CFLAGS="-DHAVE_LIBID3TAG_GETTAG ${CFLAGS}"] + +dnl Checks for ogg +AC_ARG_WITH( + ogg-header, + [AC_HELP_STRING(--with-ogg-header=DIR, [ogg header directory])], + [CFLAGS="-I$withval ${CFLAGS}"] ) +AC_ARG_WITH( + ogg-library, + [AC_HELP_STRING(--with-ogg-library=DIR, [ogg library directory])], + [LDFLAGS="-L$withval ${LDFLAGS}"] +) + AC_CHECK_HEADER( - ogg/ogg.h, - , - [AC_MSG_ERROR(ogg header not found!)] + ogg/ogg.h, + , + [AC_MSG_ERROR(ogg header not found!)] ) AC_CHECK_LIB( ogg, @@ -223,6 +242,19 @@ AC_MSG_ERROR([ogg library is not found!]) ) +dnl Checks for vorbis +AC_ARG_WITH( + vorbis-header, + [AC_HELP_STRING(--with-vorbis-header=DIR, [vorbis header directory])], + [CFLAGS="-I$withval ${CFLAGS}"] +) + +AC_ARG_WITH( + vorbis-library, + [AC_HELP_STRING(--with-vorbis-library=DIR, [vorbis library directory])], + [LDFLAGS="-L$withval ${LDFLAGS}"] +) + AC_CHECK_HEADER( vorbis/codec.h, , @@ -246,16 +278,39 @@ AC_MSG_ERROR([vorbisfile library is not found!]) ) +dnl ------------------------------------------------------------------ +dnl Check for libsmjs (SpiderMonkey JavaScript engine) +dnl ------------------------------------------------------------------ +found_smjs=no -AC_ARG_ENABLE( - debug, - [AC_HELP_STRING(--enable-debug, [Turn on debugging])] +AC_CHECK_HEADER( + [smjs/jsapi.h], + [AC_CHECK_LIB(smjs, JS_NewRuntime, [found_smjs="smjs"])] ) -if test "$enable_debug" = "yes"; then - CFLAGS="-DDEBUG -O -g ${CFLAGS}" -fi +AC_CHECK_HEADER( + [js/jsapi.h], + [AC_CHECK_LIB(js, JS_NewRuntime, [found_smjs="js"])] +) +case $found_smjs in + smjs) + AC_DEFINE(HAVE_LIBSMJS, 1, [Define if you have smjs or js library]) + AC_DEFINE(USE_LIBJS_SMJS, 1, [Using smjs library for JavaScript engine]) + AC_DEFINE(XP_UNIX, 1) + SMJS_LIBS="-lsmjs" + ;; + js) + AC_DEFINE(HAVE_LIBSMJS, 1, [Define if you have smjs or js library]) + AC_DEFINE(USE_LIBJS_JS, 1, [Using js library for JavaScript engine]) + AC_DEFINE(XP_UNIX, 1) + SMJS_LIBS="-ljs" + ;; + no) + AC_MSG_ERROR([js or smjs library is not found!]) + ;; +esac + dnl Export variables AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) @@ -266,8 +321,8 @@ AC_SUBST(VORBIS_LIBS) AC_SUBST(VORBISFILE_LIBS) -dnl Checks for library functions. -# Should the in-tree copy of SMJS be used? Only on Windows. + +dnl Should the in-tree copy of SMJS be used? Only on Windows. case "$UNAME_SYSTEM" in CYGWIN*) AM_CONDITIONAL([WIN32], true) @@ -280,6 +335,6 @@ ;; esac - +dnl Output the configure results. AC_CONFIG_FILES(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) AC_OUTPUT Modified: trunk/lib/pmp/Makefile.am =================================================================== --- trunk/lib/pmp/Makefile.am 2006-06-02 00:08:40 UTC (rev 18) +++ trunk/lib/pmp/Makefile.am 2006-06-02 17:44:51 UTC (rev 19) @@ -8,12 +8,15 @@ pmp.c \ pmp_posix.c +libpmp_la_CPPFLAGS = -DPMP_MODULES_DIR="\"$(libdir)/pmp\"" + libpmp_la_LDFLAGS = \ + -no-undefined + +libpmp_la_LIBADD = \ $(top_builddir)/lib/ucs2/libucs2.la \ $(top_builddir)/lib/filepath/libfilepath.la \ - -no-undefined + -lltdl -libpmp_la_LIBADD = -ldl - AM_CFLAGS = @CFLAGS@ INCLUDES = @INCLUDES@ Modified: trunk/lib/pmp/pmp_posix.c =================================================================== --- trunk/lib/pmp/pmp_posix.c 2006-06-02 00:08:40 UTC (rev 18) +++ trunk/lib/pmp/pmp_posix.c 2006-06-02 17:44:51 UTC (rev 19) @@ -59,7 +59,10 @@ pmphelp->num_plugins = 0; pmphelp->plugins = NULL; - inst = dlopen("cygpmp_portalplayer1-0.dll", RTLD_LAZY); + lt_dlinit(); + lt_dlsetsearchpath(PMP_MODULES_DIR); + + inst = lt_dlopenext("libpmp_portalplayer1"); if (inst) { pmphelp->num_plugins++; pmphelp->plugins = (void**)realloc(pmphelp->plugins, sizeof(void*) * pmphelp->num_plugins); @@ -68,7 +71,7 @@ fprintf(stderr, "FAILED: cygpmp_portalplayer1-0.dll\n"); } - inst = dlopen("cygpmp_iriverplus2-0.dll", RTLD_LAZY); + inst = lt_dlopenext("libpmp_iriverplus2"); if (inst) { pmphelp->num_plugins++; pmphelp->plugins = (void**)realloc(pmphelp->plugins, sizeof(void*) * pmphelp->num_plugins); @@ -77,7 +80,7 @@ fprintf(stderr, "FAILED: cygpmp_iriverplus2-0.dll\n"); } - inst = dlopen("cygpmp_irivnavi-0.dll", RTLD_LAZY); + inst = lt_dlopenext("libpmp_irivnavi"); if (inst) { pmphelp->num_plugins++; pmphelp->plugins = (void**)realloc(pmphelp->plugins, sizeof(void*) * pmphelp->num_plugins); @@ -116,7 +119,7 @@ uint32_t i; for (i = 0;i < pmphelpposix->num_plugins;++i) { - pmp_create_t func = (pmp_create_t)dlsym(pmphelpposix->plugins[i], "pmp_create"); + pmp_create_t func = (pmp_create_t)lt_dlsym(pmphelpposix->plugins[i], "pmp_create"); if (func) { ret = func(pmp, path_to_device, id); if (ret != PMP_DEVICENOTFOUND) { Modified: trunk/lib/pmp_iriverplus2/Makefile.am =================================================================== --- trunk/lib/pmp_iriverplus2/Makefile.am 2006-06-02 00:08:40 UTC (rev 18) +++ trunk/lib/pmp_iriverplus2/Makefile.am 2006-06-02 17:44:51 UTC (rev 19) @@ -1,5 +1,6 @@ # $Id$ +pmpdir=$(libdir)/pmp lib_LTLIBRARIES = libpmp_iriverplus2.la libpmp_iriverplus2_la_SOURCES = \ @@ -23,11 +24,13 @@ pmp_iriverplus2.c libpmp_iriverplus2_la_LDFLAGS = \ + -no-undefined -module -avoid-versions \ + -export-symbols ../pmp/pmp_plugin.sym + ++iriverplus2_la_LIBADD = \ $(top_builddir)/lib/ucs2/libucs2.la \ $(top_builddir)/lib/filepath/libfilepath.la \ - $(top_builddir)/lib/pmp/libpmp.la \ - -no-undefined \ - -module -export-symbols ../pmp/pmp_plugin.sym + $(top_builddir)/lib/pmp/libpmp.la AM_CFLAGS = @CFLAGS@ INCLUDES = @INCLUDES@ Modified: trunk/lib/pmp_irivnavi/Makefile.am =================================================================== --- trunk/lib/pmp_irivnavi/Makefile.am 2006-06-02 00:08:40 UTC (rev 18) +++ trunk/lib/pmp_irivnavi/Makefile.am 2006-06-02 17:44:51 UTC (rev 19) @@ -13,11 +13,13 @@ pmp_irivnavi.c libpmp_irivnavi_la_LDFLAGS = \ + -no-undefined -module -avoid-version \ + -export-symbols ../pmp/pmp_plugin.sym + +libpmp_irivnavi_la_LDFLAGS = \ $(top_builddir)/lib/ucs2/libucs2.la \ $(top_builddir)/lib/filepath/libfilepath.la \ - $(top_builddir)/lib/pmp/libpmp.la \ - -no-undefined \ - -module -export-symbols ../pmp/pmp_plugin.sym + $(top_builddir)/lib/pmp/libpmp.la AM_CFLAGS = @CFLAGS@ INCLUDES = @INCLUDES@ Modified: trunk/lib/pmp_portalplayer1/Makefile.am =================================================================== --- trunk/lib/pmp_portalplayer1/Makefile.am 2006-06-02 00:08:40 UTC (rev 18) +++ trunk/lib/pmp_portalplayer1/Makefile.am 2006-06-02 17:44:51 UTC (rev 19) @@ -20,15 +20,20 @@ util.c \ util.h \ model_iriver_h10.c \ + model_medion_mdjuke220.c \ + model_medion_mdjuke440.c \ model_sirius_s50.c \ + model_samsung.c \ pmp_portalplayer1.c libpmp_portalplayer1_la_LDFLAGS = \ + -no-undefined -module -avoid-version \ + -export-symbols ../pmp/pmp_plugin.sym + +libpmp_portalplayer1_la_LDFLAGS = \ $(top_builddir)/lib/ucs2/libucs2.la \ $(top_builddir)/lib/filepath/libfilepath.la \ - $(top_builddir)/lib/pmp/libpmp.la \ - -no-undefined \ - -module -export-symbols ../pmp/pmp_plugin.sym + $(top_builddir)/lib/pmp/libpmp.la AM_CFLAGS = @CFLAGS@ INCLUDES = @INCLUDES@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |