From 828252e0f24d00d4e4a7352fca3e2e32ebe98c94 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 20 Apr 2004 22:22:01 +0000 Subject: [PATCH] common/as-libtool.mak: Fine-tune DLL building. Original commit message from CVS: * common/as-libtool.mak: Fine-tune DLL building. * configure.ac: Link plugins against libgstreamer. Define plugindir (like gst-plugins) * examples/plugins/Makefile.am: remove plugindir * gst/autoplug/Makefile.am: DLL building fixes * gst/elements/Makefile.am: DLL building fixes. Disable pipefilter on Windows. * gst/elements/gstelements.c: Conditionally disable pipefilter. * gst/indexers/Makefile.am: DLL building fixes * gst/schedulers/Makefile.am: DLL building fixes. * libs/gst/bytestream/Makefile.am: DLL building fixes. * libs/gst/control/Makefile.am: same * libs/gst/getbits/Makefile.am: same * testsuite/Makefile.am: New dlopen directory * testsuite/dlopen/Makefile.am: Tests to check if libgstreamer works when dlopened. * testsuite/dlopen/dlopen_gst.c: (main): same * testsuite/dlopen/loadgst.c: (do_test): same --- ChangeLog | 21 ++++++++++ common | 2 +- configure.ac | 6 ++- examples/plugins/Makefile.am | 2 - gst/autoplug/Makefile.am | 14 +++++-- gst/elements/Makefile.am | 19 +++++++-- gst/elements/gstelements.c | 2 +- gst/indexers/Makefile.am | 12 +++++- gst/schedulers/Makefile.am | 73 +++++++++++++++++++++++++++++---- libs/gst/bytestream/Makefile.am | 14 ++++++- libs/gst/control/Makefile.am | 13 +++++- libs/gst/getbits/Makefile.am | 14 ++++++- plugins/elements/Makefile.am | 19 +++++++-- plugins/elements/gstelements.c | 2 +- plugins/indexers/Makefile.am | 12 +++++- tests/old/examples/plugins/Makefile.am | 2 - tests/old/testsuite/Makefile.am | 6 ++- tests/old/testsuite/dlopen/Makefile.am | 45 ++++++++++++++++++++ tests/old/testsuite/dlopen/dlopen_gst.c | 25 +++++++++++ tests/old/testsuite/dlopen/loadgst.c | 28 +++++++++++++ testsuite/Makefile.am | 6 ++- testsuite/dlopen/Makefile.am | 45 ++++++++++++++++++++ testsuite/dlopen/dlopen_gst.c | 25 +++++++++++ testsuite/dlopen/loadgst.c | 28 +++++++++++++ 24 files changed, 395 insertions(+), 40 deletions(-) create mode 100644 tests/old/testsuite/dlopen/Makefile.am create mode 100644 tests/old/testsuite/dlopen/dlopen_gst.c create mode 100644 tests/old/testsuite/dlopen/loadgst.c create mode 100644 testsuite/dlopen/Makefile.am create mode 100644 testsuite/dlopen/dlopen_gst.c create mode 100644 testsuite/dlopen/loadgst.c diff --git a/ChangeLog b/ChangeLog index b124c55..c506703 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,26 @@ 2004-04-20 David Schleef + * common/as-libtool.mak: Fine-tune DLL building. + * configure.ac: Link plugins against libgstreamer. Define plugindir + (like gst-plugins) + * examples/plugins/Makefile.am: remove plugindir + * gst/autoplug/Makefile.am: DLL building fixes + * gst/elements/Makefile.am: DLL building fixes. Disable pipefilter on + Windows. + * gst/elements/gstelements.c: Conditionally disable pipefilter. + * gst/indexers/Makefile.am: DLL building fixes + * gst/schedulers/Makefile.am: DLL building fixes. + * libs/gst/bytestream/Makefile.am: DLL building fixes. + * libs/gst/control/Makefile.am: same + * libs/gst/getbits/Makefile.am: same + * testsuite/Makefile.am: New dlopen directory + * testsuite/dlopen/Makefile.am: Tests to check if libgstreamer works + when dlopened. + * testsuite/dlopen/dlopen_gst.c: (main): same + * testsuite/dlopen/loadgst.c: (do_test): same + +2004-04-20 David Schleef + * gst/parse/grammar.y: Apply patch from Sebastien Cote to fix a memleak. (bug #140594) diff --git a/common b/common index e55182f..63d93f0 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit e55182f6eece70ff99e33b9800b27a926670dbdd +Subproject commit 63d93f01177745ba864263f0b6f976212684cb87 diff --git a/configure.ac b/configure.ac index 5a1fe2b..63be0ca 100644 --- a/configure.ac +++ b/configure.ac @@ -582,10 +582,11 @@ GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include" AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS") AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS") -GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*" -#GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).* \$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la" +GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).* \$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la" AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS") +plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR" +AC_SUBST(plugindir) dnl ################################################## dnl # deps for examples from manual # @@ -656,6 +657,7 @@ testsuite/caps/Makefile testsuite/cleanup/Makefile testsuite/clock/Makefile testsuite/debug/Makefile +testsuite/dlopen/Makefile testsuite/dynparams/Makefile testsuite/elements/Makefile testsuite/ghostpads/Makefile diff --git a/examples/plugins/Makefile.am b/examples/plugins/Makefile.am index 0d04b56..33ba9a0 100644 --- a/examples/plugins/Makefile.am +++ b/examples/plugins/Makefile.am @@ -1,5 +1,3 @@ -## we need to specify the plugindir if we want libtool to build .so files ... -plugindir=$(libdir)/gstreamer-@GST_MAJORMINOR@ plugin_LTLIBRARIES = libgstexample.la diff --git a/gst/autoplug/Makefile.am b/gst/autoplug/Makefile.am index 118ef8c..74a3b6c 100644 --- a/gst/autoplug/Makefile.am +++ b/gst/autoplug/Makefile.am @@ -1,7 +1,9 @@ -plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ -plugin_LTLIBRARIES = \ - libgstspider.la +plugin_LTLIBRARIES = libgstspider.la +AS_LIBTOOL_LIB = libgstspider + +EXTRA_DIST = $(as_libtool_EXTRA_DIST) +noinst_DATA = $(as_libtool_noinst_DATA_files) libgstspider_la_SOURCES = \ gstspider.c gstspideridentity.c \ @@ -18,3 +20,9 @@ spidertest_SOURCES = spidertest.c spidertest_CFLAGS = $(GST_CFLAGS) spidertest_LDADD = $(GST_LIBS) +install-data-local: as-libtool-install-data-local + +uninstall-local: as-libtool-uninstall-local + +include $(top_srcdir)/common/as-libtool.mak + diff --git a/gst/elements/Makefile.am b/gst/elements/Makefile.am index ffb4078..06d3b0e 100644 --- a/gst/elements/Makefile.am +++ b/gst/elements/Makefile.am @@ -4,9 +4,11 @@ # This requires building libs/gst before this dir, which we currently don't # do. -plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ - plugin_LTLIBRARIES = libgstelements.la +AS_LIBTOOL_LIB = libgstelements + +EXTRA_DIST = $(as_libtool_EXTRA_DIST) +noinst_DATA = $(as_libtool_noinst_DATA_files) # FIXME: # Disable multifilesrc on Windows, cause it uses mmap excessively @@ -14,8 +16,10 @@ plugin_LTLIBRARIES = libgstelements.la # in gstelements.c. if AS_LIBTOOL_WIN32 multifilesrc = +pipefilter = else multifilesrc = gstmultifilesrc.c +pipefilter = gstpipefilter.c endif libgstelements_la_DEPENDENCIES = ../libgstreamer-@GST_MAJORMINOR@.la @@ -32,7 +36,7 @@ libgstelements_la_SOURCES = \ gstidentity.c \ gstmd5sink.c \ $(multifilesrc) \ - gstpipefilter.c \ + $(pipefilter) \ gstshaper.c \ gststatistics.c \ gsttee.c \ @@ -40,7 +44,7 @@ libgstelements_la_SOURCES = \ libgstelements_la_CFLAGS = $(GST_CFLAGS) libgstelements_la_LIBADD = -libgstelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS) noinst_HEADERS = \ gstaggregator.h \ @@ -59,3 +63,10 @@ noinst_HEADERS = \ gststatistics.h \ gsttee.h \ gsttypefind.h + +install-data-local: as-libtool-install-data-local + +uninstall-local: as-libtool-uninstall-local + +include $(top_srcdir)/common/as-libtool.mak + diff --git a/gst/elements/gstelements.c b/gst/elements/gstelements.c index 60f351f..1504790 100644 --- a/gst/elements/gstelements.c +++ b/gst/elements/gstelements.c @@ -67,8 +67,8 @@ static struct _elements_entry _elements[] = { {"md5sink", GST_RANK_NONE, gst_md5sink_get_type}, #ifndef HAVE_WIN32 {"multifilesrc", GST_RANK_NONE, gst_multifilesrc_get_type}, -#endif {"pipefilter", GST_RANK_NONE, gst_pipefilter_get_type}, +#endif {"shaper", GST_RANK_NONE, gst_shaper_get_type}, {"statistics", GST_RANK_NONE, gst_statistics_get_type}, {"tee", GST_RANK_NONE, gst_tee_get_type}, diff --git a/gst/indexers/Makefile.am b/gst/indexers/Makefile.am index 5aa9e69..deadb82 100644 --- a/gst/indexers/Makefile.am +++ b/gst/indexers/Makefile.am @@ -1,6 +1,9 @@ -plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ plugin_LTLIBRARIES = libgstindexers.la +AS_LIBTOOL_LIB = libgstindexers + +EXTRA_DIST = $(as_libtool_EXTRA_DIST) +noinst_DATA = $(as_libtool_noinst_DATA_files) # file index uses xml if GST_DISABLE_LOADSAVE @@ -13,3 +16,10 @@ libgstindexers_la_SOURCES = gstindexers.c gstmemindex.c $(GST_LOADSAVE_SRC) libgstindexers_la_CFLAGS = $(GST_CFLAGS) libgstindexers_la_LIBADD = libgstindexers_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) + +install-data-local: as-libtool-install-data-local + +uninstall-local: as-libtool-uninstall-local + +include $(top_srcdir)/common/as-libtool.mak + diff --git a/gst/schedulers/Makefile.am b/gst/schedulers/Makefile.am index 001f151..ad092fe 100644 --- a/gst/schedulers/Makefile.am +++ b/gst/schedulers/Makefile.am @@ -1,12 +1,16 @@ -plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ if GST_DISABLE_OMEGA_COTHREADS omegaschedulers = +omegaschedulers_nola = else omegaschedulers = \ libgstbasicomegascheduler.la \ libgstentryomegascheduler.la \ libgstoptomegascheduler.la +omegaschedulers_nola = \ + libgstbasicomegascheduler \ + libgstentryomegascheduler \ + libgstoptomegascheduler endif plugin_LTLIBRARIES = \ @@ -15,45 +19,98 @@ plugin_LTLIBRARIES = \ libgstentrygthreadscheduler.la \ libgstoptscheduler.la \ libgstoptgthreadscheduler.la +AS_LIBTOOL_LIBS = \ + $(omegaschedulers_nola) \ + libgstbasicgthreadscheduler \ + libgstentrygthreadscheduler \ + libgstoptscheduler \ + libgstoptgthreadscheduler + +if AS_LIBTOOL_WIN32 +as_libtool_LDFLAGS = -no-undefined +else +as_libtool_LDFLAGS = +endif if GST_DISABLE_OMEGA_COTHREADS else libgstbasicomegascheduler_la_SOURCES = gstbasicscheduler.c libgstbasicomegascheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_OMEGA libgstbasicomegascheduler_la_LIBADD = ../libcothreads.la -libgstbasicomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstbasicomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS) endif libgstbasicgthreadscheduler_la_SOURCES = gstbasicscheduler.c libgstbasicgthreadscheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_GTHREAD -libgstbasicgthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstbasicgthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS) libgstentrygthreadscheduler_la_SOURCES = entryscheduler.c libgstentrygthreadscheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_GTHREAD -libgstentrygthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstentrygthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS) if GST_DISABLE_OMEGA_COTHREADS else libgstentryomegascheduler_la_SOURCES = entryscheduler.c libgstentryomegascheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_OMEGA libgstentryomegascheduler_la_LIBADD = ../libcothreads.la -libgstentryomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstentryomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS) endif libgstoptscheduler_la_SOURCES = gstoptimalscheduler.c libgstoptscheduler_la_CFLAGS = $(GST_CFLAGS) -libgstoptscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstoptscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS) if GST_DISABLE_OMEGA_COTHREADS else libgstoptomegascheduler_la_SOURCES = gstoptimalscheduler.c libgstoptomegascheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_OMEGA -DUSE_COTHREADS libgstoptomegascheduler_la_LIBADD = ../libcothreads.la -libgstoptomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstoptomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS) endif libgstoptgthreadscheduler_la_SOURCES = gstoptimalscheduler.c libgstoptgthreadscheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_GTHREAD -DUSE_COTHREADS -libgstoptgthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstoptgthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS) noinst_HEADERS = cothreads_compat.h gthread-cothreads.h + +if AS_LIBTOOL_WIN32 + +as_libtool_noinst_DATA_files = $(AS_LIBTOOL_LIB).lib + +as_libtool_LDFLAGS = -no-undefined + +# depend on this in install-data-local +as-libtool-install-data-local: + for i in $(AS_LIBTOOL_LIBS); do \ + $(INSTALL) $$i.lib $(DESTDIR)$(libdir) ; \ + $(INSTALL) $$i.def $(DESTDIR)$(libdir) ; \ + done + +# depend on this in uninstall-local +as-libtool-uninstall-local: + for i in $(AS_LIBTOOL_LIBS); do \ + -rm $(DESTDIR)$(libdir)/$$i.lib ; \ + -rm $(DESTDIR)$(libdir)/$$i.def ; \ + done +else + +as-libtool-install-data-local: +as-libtool-uninstall-local: + +endif + + + +%.lib: %.def + dlltool -S $(CC) -f "-c" --export-all-symbols --input-def \ + %.def --output-lib %.lib + +%.def: %.la + echo EXPORTS >%.def.tmp + nm --defined-only -g .libs/%.a | \ + grep ^0 | \ + awk '{ print $$3 }' | \ + sed 's/^/ /' >>%.def.tmp + mv %.def.tmp %.def + diff --git a/libs/gst/bytestream/Makefile.am b/libs/gst/bytestream/Makefile.am index ff5cf2d..318018f 100644 --- a/libs/gst/bytestream/Makefile.am +++ b/libs/gst/bytestream/Makefile.am @@ -1,6 +1,9 @@ -librarydir = $(libdir)/gstreamer-@GST_MAJORMINOR@ -library_LTLIBRARIES = libgstbytestream.la +plugin_LTLIBRARIES = libgstbytestream.la +AS_LIBTOOL_LIB = libgstbytestream + +EXTRA_DIST = $(as_libtool_EXTRA_DIST) +noinst_DATA = $(as_libtool_noinst_DATA_files) libgstbytestreamincludedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/bytestream libgstbytestreaminclude_HEADERS = bytestream.h @@ -8,3 +11,10 @@ libgstbytestreaminclude_HEADERS = bytestream.h libgstbytestream_la_SOURCES = bytestream.c libgstbytestream_la_CFLAGS = $(GST_CFLAGS) libgstbytestream_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) + +install-data-local: as-libtool-install-data-local + +uninstall-local: as-libtool-uninstall-local + +include $(top_srcdir)/common/as-libtool.mak + diff --git a/libs/gst/control/Makefile.am b/libs/gst/control/Makefile.am index 0023ca0..8956cfc 100644 --- a/libs/gst/control/Makefile.am +++ b/libs/gst/control/Makefile.am @@ -1,6 +1,9 @@ -librarydir = $(libdir) -library_LTLIBRARIES = libgstcontrol-@GST_MAJORMINOR@.la +lib_LTLIBRARIES = libgstcontrol-@GST_MAJORMINOR@.la +AS_LIBTOOL_LIB = libgstcontrol-@GST_MAJORMINOR@ + +EXTRA_DIST = $(as_libtool_EXTRA_DIST) +noinst_DATA = $(as_libtool_noinst_DATA_files) libgstcontrol_@GST_MAJORMINOR@_includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/control libgstcontrol_@GST_MAJORMINOR@_include_HEADERS = \ @@ -25,3 +28,9 @@ libgstcontrol_@GST_MAJORMINOR@_la_LDFLAGS = @GST_LT_LDFLAGS@ -version-info @GST_ # control uses log and exp, so we need -lm if xml is disabled libgstcontrol_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS) -lm +install-data-local: as-libtool-install-data-local + +uninstall-local: as-libtool-uninstall-local + +include $(top_srcdir)/common/as-libtool.mak + diff --git a/libs/gst/getbits/Makefile.am b/libs/gst/getbits/Makefile.am index e809c1a..359839e 100644 --- a/libs/gst/getbits/Makefile.am +++ b/libs/gst/getbits/Makefile.am @@ -1,6 +1,9 @@ -librarydir = $(libdir)/gstreamer-@GST_MAJORMINOR@ -library_LTLIBRARIES = libgstgetbits.la +plugin_LTLIBRARIES = libgstgetbits.la +AS_LIBTOOL_LIB = libgstgstgetbits + +EXTRA_DIST = $(as_libtool_EXTRA_DIST) +noinst_DATA = $(as_libtool_noinst_DATA_files) if HAVE_CPU_I386 GSTARCH_SRCS = gstgetbits_i386.s @@ -19,3 +22,10 @@ libgstgetbits_la_CFLAGS = $(GST_CFLAGS) -funroll-all-loops -finline-functions -f libgstgetbits_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) # check_PROGRAMS = gbtest + +install-data-local: as-libtool-install-data-local + +uninstall-local: as-libtool-uninstall-local + +include $(top_srcdir)/common/as-libtool.mak + diff --git a/plugins/elements/Makefile.am b/plugins/elements/Makefile.am index ffb4078..06d3b0e 100644 --- a/plugins/elements/Makefile.am +++ b/plugins/elements/Makefile.am @@ -4,9 +4,11 @@ # This requires building libs/gst before this dir, which we currently don't # do. -plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ - plugin_LTLIBRARIES = libgstelements.la +AS_LIBTOOL_LIB = libgstelements + +EXTRA_DIST = $(as_libtool_EXTRA_DIST) +noinst_DATA = $(as_libtool_noinst_DATA_files) # FIXME: # Disable multifilesrc on Windows, cause it uses mmap excessively @@ -14,8 +16,10 @@ plugin_LTLIBRARIES = libgstelements.la # in gstelements.c. if AS_LIBTOOL_WIN32 multifilesrc = +pipefilter = else multifilesrc = gstmultifilesrc.c +pipefilter = gstpipefilter.c endif libgstelements_la_DEPENDENCIES = ../libgstreamer-@GST_MAJORMINOR@.la @@ -32,7 +36,7 @@ libgstelements_la_SOURCES = \ gstidentity.c \ gstmd5sink.c \ $(multifilesrc) \ - gstpipefilter.c \ + $(pipefilter) \ gstshaper.c \ gststatistics.c \ gsttee.c \ @@ -40,7 +44,7 @@ libgstelements_la_SOURCES = \ libgstelements_la_CFLAGS = $(GST_CFLAGS) libgstelements_la_LIBADD = -libgstelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS) noinst_HEADERS = \ gstaggregator.h \ @@ -59,3 +63,10 @@ noinst_HEADERS = \ gststatistics.h \ gsttee.h \ gsttypefind.h + +install-data-local: as-libtool-install-data-local + +uninstall-local: as-libtool-uninstall-local + +include $(top_srcdir)/common/as-libtool.mak + diff --git a/plugins/elements/gstelements.c b/plugins/elements/gstelements.c index 60f351f..1504790 100644 --- a/plugins/elements/gstelements.c +++ b/plugins/elements/gstelements.c @@ -67,8 +67,8 @@ static struct _elements_entry _elements[] = { {"md5sink", GST_RANK_NONE, gst_md5sink_get_type}, #ifndef HAVE_WIN32 {"multifilesrc", GST_RANK_NONE, gst_multifilesrc_get_type}, -#endif {"pipefilter", GST_RANK_NONE, gst_pipefilter_get_type}, +#endif {"shaper", GST_RANK_NONE, gst_shaper_get_type}, {"statistics", GST_RANK_NONE, gst_statistics_get_type}, {"tee", GST_RANK_NONE, gst_tee_get_type}, diff --git a/plugins/indexers/Makefile.am b/plugins/indexers/Makefile.am index 5aa9e69..deadb82 100644 --- a/plugins/indexers/Makefile.am +++ b/plugins/indexers/Makefile.am @@ -1,6 +1,9 @@ -plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ plugin_LTLIBRARIES = libgstindexers.la +AS_LIBTOOL_LIB = libgstindexers + +EXTRA_DIST = $(as_libtool_EXTRA_DIST) +noinst_DATA = $(as_libtool_noinst_DATA_files) # file index uses xml if GST_DISABLE_LOADSAVE @@ -13,3 +16,10 @@ libgstindexers_la_SOURCES = gstindexers.c gstmemindex.c $(GST_LOADSAVE_SRC) libgstindexers_la_CFLAGS = $(GST_CFLAGS) libgstindexers_la_LIBADD = libgstindexers_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) + +install-data-local: as-libtool-install-data-local + +uninstall-local: as-libtool-uninstall-local + +include $(top_srcdir)/common/as-libtool.mak + diff --git a/tests/old/examples/plugins/Makefile.am b/tests/old/examples/plugins/Makefile.am index 0d04b56..33ba9a0 100644 --- a/tests/old/examples/plugins/Makefile.am +++ b/tests/old/examples/plugins/Makefile.am @@ -1,5 +1,3 @@ -## we need to specify the plugindir if we want libtool to build .so files ... -plugindir=$(libdir)/gstreamer-@GST_MAJORMINOR@ plugin_LTLIBRARIES = libgstexample.la diff --git a/tests/old/testsuite/Makefile.am b/tests/old/testsuite/Makefile.am index 1e9a172..34f801b 100644 --- a/tests/old/testsuite/Makefile.am +++ b/tests/old/testsuite/Makefile.am @@ -15,10 +15,12 @@ endif SUBDIRS = bins bytestream cleanup dynparams ghostpads \ caps plugin elements clock refcounting tags threads \ - indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) + indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) \ + dlopen DIST_SUBDIRS = bins bytestream caps cleanup clock dynparams elements indexers \ - plugin refcounting tags threads parse debug ghostpads + plugin refcounting tags threads parse debug ghostpads \ + dlopen tests_pass = test_gst_init tests_fail = diff --git a/tests/old/testsuite/dlopen/Makefile.am b/tests/old/testsuite/dlopen/Makefile.am new file mode 100644 index 0000000..0efa710 --- /dev/null +++ b/tests/old/testsuite/dlopen/Makefile.am @@ -0,0 +1,45 @@ + +plugin_LTLIBRARIES = libloadgst.la + +tests_pass = dlopen_gst +tests_fail = +tests_ignore = + +libloadgst_la_SOURCES = loadgst.c +libloadgst_la_CFLAGS = $(GST_CFLAGS) +libloadgst_la_LDFLAGS = -module -avoid-version $(GST_LIBS) + +dlopen_gst_SOURCES = dlopen_gst.c +dlopen_gst_CFLAGS = $(GLIB_CFLAGS) +dlopen_gst_LDFLAGS = $(GLIB_LIBS) + + +# ../Rules is included because we specifically don't want the normal +# AM_CFLAGS, etc. + +TESTS_ENVIRONMENT=\ + G_DEBUG=fatal_warnings \ + GST_PLUGIN_PATH=$(top_builddir)/gst:. \ + GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml + +check_PROGRAMS = $(tests_pass) $(tests_fail) $(tests_ignore) + +# make all tests depend on the versioned gst-register +$(tests_pass) $(tests_fail): $(top_builddir)/tools/gst-register-@GST_MAJORMINOR@ + +# rebuild gst-register-@GST_MAJORMINOR@ if needed +# the EXEEXT is because am 1.6 complained about overrides +$(top_builddir)/tools/gst-register-@GST_MAJORMINOR@$(EXEEXT): + cd $(top_builddir)/tools && make + +TESTS = $(top_builddir)/tools/gst-register-@GST_MAJORMINOR@ \ + $(tests_pass) $(tests_fail) +XFAIL_TESTS = $(tests_fail) + +# override to _not_ install the test plugins +install-pluginLTLIBRARIES: + +# This rule is here so make distcheck works on machines where core +# dumps have PIDs appended +CLEANFILES = core.* + diff --git a/tests/old/testsuite/dlopen/dlopen_gst.c b/tests/old/testsuite/dlopen/dlopen_gst.c new file mode 100644 index 0000000..d3b85a2 --- /dev/null +++ b/tests/old/testsuite/dlopen/dlopen_gst.c @@ -0,0 +1,25 @@ + +#include + + +int +main (int argc, char *argv[]) +{ + GModule *module; + void (*symbol) (void); + gboolean ret; + + module = g_module_open (".libs/libloadgst.so", + G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY); + g_assert (module != NULL); + + ret = g_module_symbol (module, "gst_init", (gpointer *) & symbol); + g_print ("'gst_init' is %s\n", ret ? "visible" : "not visible"); + + ret = g_module_symbol (module, "do_test", (gpointer *) & symbol); + g_assert (ret); + + symbol (); + + exit (0); +} diff --git a/tests/old/testsuite/dlopen/loadgst.c b/tests/old/testsuite/dlopen/loadgst.c new file mode 100644 index 0000000..9bfbd0a --- /dev/null +++ b/tests/old/testsuite/dlopen/loadgst.c @@ -0,0 +1,28 @@ + +#include + + +void +do_test (void) +{ + GstElement *pipeline; + int i; + gboolean ret; + + gst_init (NULL, NULL); + + pipeline = gst_parse_launch ("fakesrc ! fakesink", NULL); + g_assert (pipeline != NULL); + + + gst_element_set_state (pipeline, GST_STATE_PLAYING); + + for (i = 0; i < 100; i++) { + ret = gst_bin_iterate (GST_BIN (pipeline)); + g_assert (ret); + g_print ("%s", (i & 1) ? "+" : "-"); + } + g_print ("\n"); + + gst_object_unref (GST_OBJECT (pipeline)); +} diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 1e9a172..34f801b 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -15,10 +15,12 @@ endif SUBDIRS = bins bytestream cleanup dynparams ghostpads \ caps plugin elements clock refcounting tags threads \ - indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) + indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) \ + dlopen DIST_SUBDIRS = bins bytestream caps cleanup clock dynparams elements indexers \ - plugin refcounting tags threads parse debug ghostpads + plugin refcounting tags threads parse debug ghostpads \ + dlopen tests_pass = test_gst_init tests_fail = diff --git a/testsuite/dlopen/Makefile.am b/testsuite/dlopen/Makefile.am new file mode 100644 index 0000000..0efa710 --- /dev/null +++ b/testsuite/dlopen/Makefile.am @@ -0,0 +1,45 @@ + +plugin_LTLIBRARIES = libloadgst.la + +tests_pass = dlopen_gst +tests_fail = +tests_ignore = + +libloadgst_la_SOURCES = loadgst.c +libloadgst_la_CFLAGS = $(GST_CFLAGS) +libloadgst_la_LDFLAGS = -module -avoid-version $(GST_LIBS) + +dlopen_gst_SOURCES = dlopen_gst.c +dlopen_gst_CFLAGS = $(GLIB_CFLAGS) +dlopen_gst_LDFLAGS = $(GLIB_LIBS) + + +# ../Rules is included because we specifically don't want the normal +# AM_CFLAGS, etc. + +TESTS_ENVIRONMENT=\ + G_DEBUG=fatal_warnings \ + GST_PLUGIN_PATH=$(top_builddir)/gst:. \ + GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml + +check_PROGRAMS = $(tests_pass) $(tests_fail) $(tests_ignore) + +# make all tests depend on the versioned gst-register +$(tests_pass) $(tests_fail): $(top_builddir)/tools/gst-register-@GST_MAJORMINOR@ + +# rebuild gst-register-@GST_MAJORMINOR@ if needed +# the EXEEXT is because am 1.6 complained about overrides +$(top_builddir)/tools/gst-register-@GST_MAJORMINOR@$(EXEEXT): + cd $(top_builddir)/tools && make + +TESTS = $(top_builddir)/tools/gst-register-@GST_MAJORMINOR@ \ + $(tests_pass) $(tests_fail) +XFAIL_TESTS = $(tests_fail) + +# override to _not_ install the test plugins +install-pluginLTLIBRARIES: + +# This rule is here so make distcheck works on machines where core +# dumps have PIDs appended +CLEANFILES = core.* + diff --git a/testsuite/dlopen/dlopen_gst.c b/testsuite/dlopen/dlopen_gst.c new file mode 100644 index 0000000..d3b85a2 --- /dev/null +++ b/testsuite/dlopen/dlopen_gst.c @@ -0,0 +1,25 @@ + +#include + + +int +main (int argc, char *argv[]) +{ + GModule *module; + void (*symbol) (void); + gboolean ret; + + module = g_module_open (".libs/libloadgst.so", + G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY); + g_assert (module != NULL); + + ret = g_module_symbol (module, "gst_init", (gpointer *) & symbol); + g_print ("'gst_init' is %s\n", ret ? "visible" : "not visible"); + + ret = g_module_symbol (module, "do_test", (gpointer *) & symbol); + g_assert (ret); + + symbol (); + + exit (0); +} diff --git a/testsuite/dlopen/loadgst.c b/testsuite/dlopen/loadgst.c new file mode 100644 index 0000000..9bfbd0a --- /dev/null +++ b/testsuite/dlopen/loadgst.c @@ -0,0 +1,28 @@ + +#include + + +void +do_test (void) +{ + GstElement *pipeline; + int i; + gboolean ret; + + gst_init (NULL, NULL); + + pipeline = gst_parse_launch ("fakesrc ! fakesink", NULL); + g_assert (pipeline != NULL); + + + gst_element_set_state (pipeline, GST_STATE_PLAYING); + + for (i = 0; i < 100; i++) { + ret = gst_bin_iterate (GST_BIN (pipeline)); + g_assert (ret); + g_print ("%s", (i & 1) ? "+" : "-"); + } + g_print ("\n"); + + gst_object_unref (GST_OBJECT (pipeline)); +} -- 2.7.4