From 2b0b78882c9015f35a69b70dfdb9f04597002182 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 4 Oct 2002 13:13:54 +0000 Subject: [PATCH] * ./bootstrap: we use the proper linker for plugin compilation. * ./modules/misc/testsuite/*: moved the null module into three test modules that are only built when --enable-testsuite is activated. This directory can be a good place for compilation tests or performance benchmarks. --- bootstrap | 7 ++- configure.ac.in | 27 +++++++++-- modules/Makefile.am | 1 + modules/misc/Modules.am | 1 - modules/misc/gtk_main.c | 10 ++-- modules/misc/network/ipv6.c | 4 +- modules/misc/testsuite/.cvsignore | 2 + modules/misc/testsuite/Modules.am | 3 ++ modules/misc/{null.c => testsuite/test1.c} | 6 +-- modules/misc/testsuite/test2.cpp | 40 ++++++++++++++++ modules/misc/testsuite/test3.m | 54 ++++++++++++++++++++++ 11 files changed, 136 insertions(+), 19 deletions(-) create mode 100644 modules/misc/testsuite/.cvsignore create mode 100644 modules/misc/testsuite/Modules.am rename modules/misc/{null.c => testsuite/test1.c} (90%) create mode 100644 modules/misc/testsuite/test2.cpp create mode 100644 modules/misc/testsuite/test3.m diff --git a/bootstrap b/bootstrap index 1d2146bc73..09c99571fa 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,7 @@ #! /bin/sh ## bootstrap file for vlc, the VideoLAN Client -## $Id: bootstrap,v 1.17 2002/10/03 08:44:11 sam Exp $ +## $Id: bootstrap,v 1.18 2002/10/04 13:13:54 sam Exp $ ## ## Authors: Samuel Hocevar @@ -73,13 +73,16 @@ include ${dir}/Modules.am EOF sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | while read mod do + LINKER="LINK" if echo "$ALL_FLAGS" | grep '^CPPFLAGS_'${mod}'=$' >/dev/null 2>&1; then echo "AC_SUBST(CPPFLAGS_${mod})" >> configure.ac; fi if echo "$ALL_FLAGS" | grep '^CFLAGS_'${mod}'=$' >/dev/null 2>&1; then echo "AC_SUBST(CFLAGS_${mod})" >> configure.ac; fi if echo "$ALL_FLAGS" | grep '^CXXFLAGS_'${mod}'=$' >/dev/null 2>&1; then + LINKER="CXXLINK" echo "AC_SUBST(CXXFLAGS_${mod})" >> configure.ac; fi if echo "$ALL_FLAGS" | grep '^OBJCFLAGS_'${mod}'=$' >/dev/null 2>&1; then + LINKER="OBJCLINK" echo "AC_SUBST(OBJCFLAGS_${mod})" >> configure.ac; fi if echo "$ALL_FLAGS" | grep '^LDFLAGS_'${mod}'=$' >/dev/null 2>&1; then echo "AC_SUBST(LDFLAGS_${mod})" >> configure.ac; fi @@ -150,7 +153,7 @@ lib${mod}dir = \$(libdir)/vlc/${topdir} MOSTLYCLEANFILES += \$(D_${mod}_p) ${PRIVATE}noinst_LIBRARIES += \$(L_${mod}_p) ${PRIVATE}${dir}/lib${mod}_plugin\$(LIBEXT): \$(${sym}_lib${mod}_plugin_a_OBJECTS) -${PRIVATE} \$(CC) \$^ -o \$@ -shared \$(LDFLAGS) \$(LDFLAGS_plugins) \$(LDFLAGS_${mod}) +${PRIVATE} \$(${LINKER}) \$^ -o \$@ -shared \$(LDFLAGS_plugins) \$(LDFLAGS_${mod}) EOF diff --git a/configure.ac.in b/configure.ac.in index 727975e187..ad31ad25f9 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -507,8 +507,7 @@ esac dnl dnl default modules dnl -PLUGINS="${PLUGINS} dummy null" -PLUGINS="${PLUGINS} rc logger access_file memcpy" +PLUGINS="${PLUGINS} dummy rc logger access_file memcpy" PLUGINS="${PLUGINS} es audio mpeg_system ps ts" PLUGINS="${PLUGINS} idct idctclassic motion mpeg_video spudec mpeg_audio" #PLUGINS="${PLUGINS} a52old imdct downmix" @@ -2091,13 +2090,30 @@ then fi AM_CONDITIONAL(BUILD_MOZILLA,${mozilla}) +dnl +dnl test plugins +dnl +AC_ARG_ENABLE(testsuite, + [ --enable-testsuite build test modules (default disabled)]) +if test "x${enable_testsuite}" = "xyes" +then + TESTS="test1 test2 test3" + dnl we define those so that bootstrap sets the right linker + CXXFLAGS_test2="${CXXFLAGS_test2}" + OBJCFLAGS_test3="${OBJCFLAGS_test3}" + dnl this one is needed until automake knows what to do + LDFLAGS_test3="${LDFLAGS_test3} -lobjc" + PLUGINS="${PLUGINS} ${TESTS}" + BUILTINS="${BUILTINS} ${TESTS}" +fi + dnl dnl gtk_main plugin dnl if test "x${NEED_GTK_MAIN}" != "xno" then PLUGINS="${PLUGINS} gtk_main" - CFLAGS_gtk = "${CFLAGS_gtk} -DNEED_GTK_MAIN" + CFLAGS_gtk="${CFLAGS_gtk} -DNEED_GTK_MAIN" CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}" LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}" fi @@ -2123,8 +2139,9 @@ AC_ARG_ENABLE(plugins, plugin_support=false fi]) -dnl Automagically disable plugins if there is no system support for .so files -dnl don't forget vlc-win32 still can load .so as plugins +dnl Automagically disable plugins if there is no system support for +dnl dynamically loadable files (.so, .dll, .dylib). +dnl don't forget vlc-win32 still can load .dll as plugins if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32" then echo "*** Your system doesn't have plugin support. All plugins will be built" diff --git a/modules/Makefile.am b/modules/Makefile.am index ef41398b42..26a8d9864e 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -49,6 +49,7 @@ EXTRA_DIST = \ misc/logger/Modules.am \ misc/memcpy/Modules.am \ misc/network/Modules.am \ + misc/testsuite/Modules.am \ video_chroma/Modules.am \ video_filter/Modules.am \ video_filter/deinterlace/Modules.am \ diff --git a/modules/misc/Modules.am b/modules/misc/Modules.am index 134e8abf76..b6a1f2b3fc 100644 --- a/modules/misc/Modules.am +++ b/modules/misc/Modules.am @@ -1,3 +1,2 @@ -SOURCES_null = modules/misc/null.c SOURCES_gtk_main = modules/misc/gtk_main.c SOURCES_gnome_main = modules/misc/gtk_main.c diff --git a/modules/misc/gtk_main.c b/modules/misc/gtk_main.c index adde6522ab..0f5f2c875a 100644 --- a/modules/misc/gtk_main.c +++ b/modules/misc/gtk_main.c @@ -2,7 +2,7 @@ * gtk_main.c : Gtk+ wrapper for gtk_main ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: gtk_main.c,v 1.7 2002/10/03 13:21:55 sam Exp $ + * $Id: gtk_main.c,v 1.8 2002/10/04 13:13:54 sam Exp $ * * Authors: Samuel Hocevar * @@ -139,10 +139,7 @@ static void Close( vlc_object_t *p_this ) vlc_mutex_unlock( &p_this->p_libvlc->global_lock ); } -static gint foo(gpointer foo) -{ - return TRUE; -} +static gint foo( gpointer bar ) { return TRUE; } /***************************************************************************** * GtkMain: Gtk+ thread @@ -174,7 +171,8 @@ static void GtkMain( vlc_object_t *p_this ) vlc_thread_ready( p_this ); - /* If we don't add this simple timeout, gtk_main remains stuck ... */ + /* If we don't add this simple timeout, gtk_main remains stuck if + * we try to close the window without having sent any gtk event. */ gtk_timeout_add( INTF_IDLE_SLEEP / 1000, foo, p_this ); /* Enter Gtk mode */ diff --git a/modules/misc/network/ipv6.c b/modules/misc/network/ipv6.c index e76b52a95b..e76efd4d4f 100644 --- a/modules/misc/network/ipv6.c +++ b/modules/misc/network/ipv6.c @@ -2,7 +2,7 @@ * ipv6.c: IPv6 network abstraction layer ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: ipv6.c,v 1.2 2002/08/08 00:35:11 sam Exp $ + * $Id: ipv6.c,v 1.3 2002/10/04 13:13:54 sam Exp $ * * Authors: Alexis Guillard * Christophe Massiot @@ -146,7 +146,7 @@ static int BuildAddr( struct sockaddr_in6 * p_socket, p_socket->sin6_scope_id = 0; #endif #if 0 - msg_Warn( p_this, " = #%i\n", p_socket->sin6_scope_id ); + msg_Warn( p_this, " = #%i", p_socket->sin6_scope_id ); #endif } psz_address[strlen(psz_address) - 1] = '\0' ; diff --git a/modules/misc/testsuite/.cvsignore b/modules/misc/testsuite/.cvsignore new file mode 100644 index 0000000000..ec96903b9d --- /dev/null +++ b/modules/misc/testsuite/.cvsignore @@ -0,0 +1,2 @@ +.deps +.dirstamp diff --git a/modules/misc/testsuite/Modules.am b/modules/misc/testsuite/Modules.am new file mode 100644 index 0000000000..7225de53a6 --- /dev/null +++ b/modules/misc/testsuite/Modules.am @@ -0,0 +1,3 @@ +SOURCES_test1 = modules/misc/testsuite/test1.c +SOURCES_test2 = modules/misc/testsuite/test2.cpp +SOURCES_test3 = modules/misc/testsuite/test3.m diff --git a/modules/misc/null.c b/modules/misc/testsuite/test1.c similarity index 90% rename from modules/misc/null.c rename to modules/misc/testsuite/test1.c index 046c5e67dc..c42177a27d 100644 --- a/modules/misc/null.c +++ b/modules/misc/testsuite/test1.c @@ -1,8 +1,8 @@ /***************************************************************************** - * null.c : NULL module for vlc + * test1.c : Empty C module for vlc ***************************************************************************** * Copyright (C) 2000-2001 VideoLAN - * $Id: null.c,v 1.1 2002/08/20 18:08:51 sam Exp $ + * $Id: test1.c,v 1.1 2002/10/04 13:13:54 sam Exp $ * * Authors: Samuel Hocevar * @@ -30,6 +30,6 @@ * Module descriptor. *****************************************************************************/ vlc_module_begin(); - set_description( _("the module that does nothing") ); + set_description( _("C module that does nothing") ); vlc_module_end(); diff --git a/modules/misc/testsuite/test2.cpp b/modules/misc/testsuite/test2.cpp new file mode 100644 index 0000000000..629b4215e4 --- /dev/null +++ b/modules/misc/testsuite/test2.cpp @@ -0,0 +1,40 @@ +/***************************************************************************** + * test2.cpp : Empty C++ module for vlc + ***************************************************************************** + * Copyright (C) 2000-2001 VideoLAN + * $Id: test2.cpp,v 1.1 2002/10/04 13:13:54 sam Exp $ + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#include + +#include + +/***************************************************************************** + * Module descriptor. + *****************************************************************************/ +vlc_module_begin(); + /* Minimal C++ usage */ + string description = "C++ module that does nothing"; + set_description( _( description.c_str() ) ); +vlc_module_end(); + + diff --git a/modules/misc/testsuite/test3.m b/modules/misc/testsuite/test3.m new file mode 100644 index 0000000000..bae2bba97c --- /dev/null +++ b/modules/misc/testsuite/test3.m @@ -0,0 +1,54 @@ +/***************************************************************************** + * test3.m : Empty Objective C module for vlc + ***************************************************************************** + * Copyright (C) 2000-2001 VideoLAN + * $Id: test3.m,v 1.1 2002/10/04 13:13:54 sam Exp $ + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#include + +#include + +/***************************************************************************** + * The description class + *****************************************************************************/ +@class Desc; + +@interface Desc : Object ++ (char*) ription; +@end + +@implementation Desc ++ (char*) ription +{ + return "Objective C module that does nothing"; +} +@end + +/***************************************************************************** + * Module descriptor. + *****************************************************************************/ +vlc_module_begin(); + set_description( _([Desc ription]) ); +vlc_module_end(); + + -- 2.39.2