]> git.sesse.net Git - vlc/commitdiff
* ./bootstrap: we use the proper linker for plugin compilation.
authorSam Hocevar <sam@videolan.org>
Fri, 4 Oct 2002 13:13:54 +0000 (13:13 +0000)
committerSam Hocevar <sam@videolan.org>
Fri, 4 Oct 2002 13:13:54 +0000 (13:13 +0000)
  * ./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
configure.ac.in
modules/Makefile.am
modules/misc/Modules.am
modules/misc/gtk_main.c
modules/misc/network/ipv6.c
modules/misc/testsuite/.cvsignore [new file with mode: 0644]
modules/misc/testsuite/Modules.am [new file with mode: 0644]
modules/misc/testsuite/test1.c [moved from modules/misc/null.c with 90% similarity]
modules/misc/testsuite/test2.cpp [new file with mode: 0644]
modules/misc/testsuite/test3.m [new file with mode: 0644]

index 1d2146bc73569d19ab788bcb1b6a8a0eab6b9521..09c99571fa396e4137883cb15eb7880e4bccf220 100755 (executable)
--- 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 <sam@zoy.org>
 
@@ -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
index 727975e18735b71cd87e92c8874363f3b0425f85..ad31ad25f9c57d6a8854dde429022cb7f6534c49 100644 (file)
@@ -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"
index ef41398b42971c41c16eaa2b2c29097d90ca2587..26a8d9864ef77758a6aa3a9c1afa2658880789df 100644 (file)
@@ -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 \
index 134e8abf76b7f820d8e2790fdf4d8f2a2956181c..b6a1f2b3fcc10be4b911aebd4a121cf3f5fdf5fc 100644 (file)
@@ -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
index adde6522ab0be4528ca0bf14d5d9923e20194a16..0f5f2c875a5ad94f925938e75c657ffea3638354 100644 (file)
@@ -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 <sam@zoy.org>
  *
@@ -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 */
index e76b52a95be1cfa4930276a8fb98e94453f7708f..e76efd4d4fc1b824f244908efa5df1bed124dcee 100644 (file)
@@ -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 <alexis.guillard@bt.com>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -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 (file)
index 0000000..ec96903
--- /dev/null
@@ -0,0 +1,2 @@
+.deps
+.dirstamp
diff --git a/modules/misc/testsuite/Modules.am b/modules/misc/testsuite/Modules.am
new file mode 100644 (file)
index 0000000..7225de5
--- /dev/null
@@ -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
similarity index 90%
rename from modules/misc/null.c
rename to modules/misc/testsuite/test1.c
index 046c5e67dcd9c07017debdcc72994601fdc3ee24..c42177a27de54bdbaa199ae84decfbfb63585e52 100644 (file)
@@ -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 <sam@zoy.org>
  *
@@ -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 (file)
index 0000000..629b421
--- /dev/null
@@ -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 <sam@zoy.org>
+ *
+ * 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 <vlc/vlc.h>
+
+#include <string>
+
+/*****************************************************************************
+ * 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 (file)
index 0000000..bae2bba
--- /dev/null
@@ -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 <sam@zoy.org>
+ *
+ * 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 <vlc/vlc.h>
+
+#include <objc/Object.h>
+
+/*****************************************************************************
+ * 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();
+
+