From 8bbbcc31b7479f7ba33db7889b730cbb892e2744 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 17 Jul 2003 12:06:10 +0000 Subject: [PATCH] * mozilla/Makefile.am: Moved mozilla plugin generation directives here. * configure.ac: Propagate $(top_srcdir) to the vlc-config call. --- Makefile.am | 85 +------------------------------------ configure.ac | 5 ++- mozilla/.cvsignore | 11 ++++- mozilla/Makefile.am | 101 ++++++++++++++++++++++++++++++++++++++++++++ vlc-config.in.in | 15 ++++--- 5 files changed, 123 insertions(+), 94 deletions(-) create mode 100644 mozilla/Makefile.am diff --git a/Makefile.am b/Makefile.am index b1517ddf23..a5b1ac53d9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,7 +7,7 @@ NULL = # SUBDIRS stores the directories where a "make" is required when building # something. DIST_SUBDIRS stores the directories where nothing is built but # which have makefiles with distribution information. -SUBDIRS = intl modules . share po m4 +SUBDIRS = intl modules mozilla . share po m4 DIST_SUBDIRS = $(SUBDIRS) src debian doc ipkg lib autotools EXTRA_DIST = \ @@ -565,89 +565,6 @@ package-macosx: # Clean up rm -Rf $(srcdir)/tmp -############################################################################### -# Building the Mozilla plugin -############################################################################### - -noinst_LIBRARIES = $(noinst_LIBRARIES_mozilla) - -MOSTLYCLEANFILES = $(LIBRARIES_mozilla) - -EXTRA_DIST += $(SOURCES_mozilla) mozilla/vlcintf.idl - -BUILT_SOURCES += $(BUILT_SOURCES_mozilla) - -SOURCES_mozilla = \ - mozilla/vlcshell.cpp \ - mozilla/vlcplugin.cpp \ - mozilla/vlcplugin.h \ - mozilla/vlcpeer.cpp \ - mozilla/vlcpeer.h \ - mozilla/support/classinfo.h \ - $(SOURCES_mozilla_win32) \ - $(SOURCES_mozilla_macosx) \ - $(SOURCES_mozilla_unix) \ - $(NULL) - -# Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix -# the common naming scheme is lib******plugin.so. Also, we need npwin.cpp -# under Win32 and npunix.c under Unix. -if HAVE_WIN32 -LIBRARIES_mozilla = mozilla/npvlc$(LIBEXT) -SOURCES_mozilla_win32 = mozilla/support/npwin.cpp -CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32 -else -if HAVE_DARWIN -# We don't define LIBRARIES_mozilla because we'll be using project builder -SOURCES_mozilla_macosx = mozilla/support/npmac.cpp -else -LIBRARIES_mozilla = mozilla/libvlcplugin$(LIBEXT) -SOURCES_mozilla_unix = mozilla/support/npunix.c -endif -endif - -if BUILD_MOZILLA -if UNTRUE -noinst_LIBRARIES_mozilla = mozilla/libplugin.a -endif - -mozilla_libplugin_a_SOURCES = $(SOURCES_mozilla) -mozilla_libplugin_a_CFLAGS = `$(VLC_CONFIG) --cflags mozilla pic` \ - $(CPPFLAGS_mozilla_EXTRA) -Imozilla -mozilla_libplugin_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla pic` \ - $(CPPFLAGS_mozilla_EXTRA) -Imozilla -mozilla_libplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(DATA_npvlc_rc) - -BUILT_SOURCES_mozilla = mozilla/vlcintf.h -$(SOURCES_mozilla): mozilla/vlcintf.h - -mozilla_plugin_DATA = $(LIBRARIES_mozilla) -mozilla_plugindir = $(libdir)/mozilla/plugins -$(LIBRARIES_mozilla): $(mozilla_libplugin_a_OBJECTS) \ - $(mozilla_libplugin_a_DEPENDENCIES) stamp-pic - $(CXXLINK) $(mozilla_libplugin_a_OBJECTS) $(DATA_npvlc_rc) \ - lib/libvlc_pic.a -shared \ - `$(VLC_CONFIG) --libs vlc mozilla builtin pic` - -mozilla_vlcintf_xpt_DATA = mozilla/vlcintf.xpt -mozilla_vlcintf_xptdir = $(libdir)/mozilla/components -mozilla/vlcintf.xpt: mozilla/vlcintf.idl - $(XPIDL) -I/usr/share/idl/mozilla -I/usr/lib/mozilla/include/idl \ - -m typelib -o mozilla/vlcintf $(srcdir)/mozilla/vlcintf.idl - -mozilla/vlcintf.h: mozilla/vlcintf.idl - $(XPIDL) -I/usr/share/idl/mozilla -I/usr/lib/mozilla/include/idl \ - -m header -o mozilla/vlcintf $(srcdir)/mozilla/vlcintf.idl - -if HAVE_WIN32 -DATA_npvlc_rc = $(noinst_mozilla_npvlc_rc_DATA) -noinst_mozilla_npvlc_rc_DATA = mozilla/npvlc_rc.$(OBJEXT) -noinst_mozilla_npvlc_rcdir = $(libdir) -mozilla/npvlc_rc.$(OBJEXT): mozilla/npvlc_rc.rc - $(WINDRES) --include-dir $(srcdir)/mozilla -i $< -o $@ -endif -endif - ############################################################################### # Stamp rules ############################################################################### diff --git a/configure.ac b/configure.ac index cbddc503d4..b22ca3d7af 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Autoconf settings for vlc -dnl $Id: configure.ac,v 1.31 2003/07/16 16:06:56 sam Exp $ +dnl $Id: configure.ac,v 1.32 2003/07/17 12:06:10 sam Exp $ AC_INIT(vlc,0.6.0) @@ -3193,7 +3193,7 @@ AC_SUBST(PLUGIN_PATH) dnl dnl Handle substvars that use $(top_srcdir) dnl -VLC_CONFIG="\$(top_builddir)/vlc-config" +VLC_CONFIG="top_srcdir=\"\$(top_srcdir)\" \$(top_builddir)/vlc-config" AC_SUBST(VLC_CONFIG) CPPFLAGS_save="${CPPFLAGS_save} -I\$(top_srcdir)/include" @@ -3239,6 +3239,7 @@ AC_OUTPUT([ ipkg/Makefile lib/Makefile modules/Makefile + mozilla/Makefile m4/Makefile po/Makefile.in share/Makefile diff --git a/mozilla/.cvsignore b/mozilla/.cvsignore index 2a098b9455..7488642292 100644 --- a/mozilla/.cvsignore +++ b/mozilla/.cvsignore @@ -1,5 +1,12 @@ +.deps +.dirstamp +*.lo +*.la *.dll +*.dylib +*.sl +*.so +Makefile.in +Makefile vlcintf.h vlcintf.xpt -.deps -.dirstamp diff --git a/mozilla/Makefile.am b/mozilla/Makefile.am new file mode 100644 index 0000000000..7737bf2854 --- /dev/null +++ b/mozilla/Makefile.am @@ -0,0 +1,101 @@ +############################################################################### +# Building the Mozilla plugin +############################################################################### + +noinst_LIBRARIES = $(noinst_LIBRARIES_mozilla) + +MOSTLYCLEANFILES = $(LIBRARIES_mozilla) +EXTRA_DIST = $(SOURCES_mozilla) vlcintf.idl +BUILT_SOURCES = $(BUILT_SOURCES_mozilla) + +SOURCES_mozilla = \ + vlcshell.cpp \ + vlcplugin.cpp \ + vlcplugin.h \ + vlcpeer.cpp \ + vlcpeer.h \ + support/classinfo.h \ + $(SOURCES_win32) \ + $(SOURCES_macosx) \ + $(SOURCES_unix) \ + $(NULL) + +# Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix +# the common naming scheme is lib******plugin.so. Also, we need npwin.cpp +# under Win32 and npunix.c under Unix. +if HAVE_WIN32 +LIBRARIES_mozilla = npvlc$(LIBEXT) +SOURCES_win32 = support/npwin.cpp +CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32 +else +if HAVE_DARWIN +# We don't define LIBRARIES_mozilla because we'll be using project builder +SOURCES_macosx = support/npmac.cpp +else +LIBRARIES_mozilla = libvlcplugin$(LIBEXT) +SOURCES_unix = support/npunix.c +endif +endif + +if BUILD_MOZILLA +if UNTRUE +noinst_LIBRARIES_mozilla = libplugin.a +endif + +libplugin_a_SOURCES = $(SOURCES_mozilla) +libplugin_a_CFLAGS = `$(VLC_CONFIG) --cflags mozilla pic` \ + $(CPPFLAGS_mozilla_EXTRA) -Imozilla +libplugin_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla pic` \ + $(CPPFLAGS_mozilla_EXTRA) -Imozilla +libplugin_a_DEPENDENCIES = $(DATA_npvlc_rc) + +BUILT_SOURCES_mozilla = vlcintf.h +$(SOURCES_mozilla): vlcintf.h + +plugin_DATA = $(LIBRARIES_mozilla) +plugindir = $(libdir)/mozilla/plugins +$(LIBRARIES_mozilla): $(libplugin_a_OBJECTS) \ + $(libplugin_a_DEPENDENCIES) $(top_builddir)/stamp-pic + $(CXXLINK) $(libplugin_a_OBJECTS) $(DATA_npvlc_rc) \ + $(top_builddir)/lib/libvlc_pic.a -shared \ + `$(VLC_CONFIG) --libs vlc mozilla builtin pic` + +vlcintf_xpt_DATA = vlcintf.xpt +vlcintf_xptdir = $(libdir)/mozilla/components +vlcintf.xpt: vlcintf.idl + $(XPIDL) -I/usr/share/idl/mozilla -I/usr/lib/mozilla/include/idl \ + -m typelib -o vlcintf $(srcdir)/vlcintf.idl + +vlcintf.h: vlcintf.idl + $(XPIDL) -I/usr/share/idl/mozilla -I/usr/lib/mozilla/include/idl \ + -m header -o vlcintf $(srcdir)/vlcintf.idl + +if HAVE_WIN32 +DATA_npvlc_rc = $(noinst_npvlc_rc_DATA) +noinst_npvlc_rc_DATA = npvlc_rc.$(OBJEXT) +noinst_npvlc_rcdir = $(libdir) +npvlc_rc.$(OBJEXT): npvlc_rc.rc + $(WINDRES) --include-dir $(srcdir)/mozilla -i $< -o $@ +endif +endif + +############################################################################### +# Stamp rules +############################################################################### +clean: clean-stamp +clean-stamp: + rm -f stamp-pic + +stamp-pic: FORCE + @for dep in "" `$(VLC_CONFIG) --target builtin pic`; do \ + if test "$${dep}" -nt "$(LIBRARIES_mozilla)"; then \ + rm -f $@; \ + break; \ + fi; \ + done + @if test ! -f $@; then printf "" > $@; fi + +############################################################################### +# Force rule +############################################################################### +FORCE: diff --git a/vlc-config.in.in b/vlc-config.in.in index ac1aba49a8..c437224300 100644 --- a/vlc-config.in.in +++ b/vlc-config.in.in @@ -77,9 +77,12 @@ fi # No need to include the default @*FLAGS@ values here because they are # automatically added when using $(COMPILE), $(CXXCOMPILE) or $(OBJCCOMPILE) # -if test "@includedir@" != /usr/include ; then +if test "@includedir@" != "/usr/include"; then includes="-I@includedir@" fi +if test "${top_srcdir}" != ""; then + top_srcdir="${top_srcdir}/" +fi cppflags="${includes}" libs="-L@libdir@" module="" @@ -243,7 +246,7 @@ if test "${echo_target}" = yes; then for module in `echo "${plugins}"`; do register_targets "${module}" done - for target in `echo "${list}"`; do printf "modules/${target}_plugin "; done + for target in `echo "${list}"`; do printf "${top_srcdir}modules/${target}_plugin "; done printf '\n' fi if test "${echo_builtin}" = yes; then @@ -251,9 +254,9 @@ if test "${echo_target}" = yes; then register_targets "${module}" done if test "${echo_pic}" = yes; then - for target in `echo "${list}"`; do printf "modules/${target}_pic.a "; done + for target in `echo "${list}"`; do printf "${top_srcdir}modules/${target}_pic.a "; done else - for target in `echo "${list}"`; do printf "modules/${target}.a "; done + for target in `echo "${list}"`; do printf "${top_srcdir}modules/${target}.a "; done fi printf '\n' fi @@ -285,9 +288,9 @@ if test "${echo_libs}" = yes; then register_flags "${module}" done if test "${echo_pic}" = yes; then - for target in `echo "${list}"`; do printf "modules/${target}_pic.a "; done + for target in `echo "${list}"`; do printf "${top_srcdir}modules/${target}_pic.a "; done else - for target in `echo "${list}"`; do printf "modules/${target}.a "; done + for target in `echo "${list}"`; do printf "${top_srcdir}modules/${target}.a "; done fi fi echo "${libs} ${ldflags}" -- 2.39.2