rm -f config.status config.cache config.log
rm -f gmon.out core build-stamp
rm -rf .dep
- rm -rf debian/tmp debian/files debian/*.debhelper debian/*.substvars
- find debian/* -type d -maxdepth 0 -name 'vlc-*' | xargs rm -rf
install:
mkdir -p $(prefix)/bin
$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
#
-# Real targets
+# Main application target
#
+
vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
ifeq ($(SYS),beos)
$(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
$(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
endif
+#
+# Plugin targets
+#
+
lib/beos.so: $(PLUGIN_BEOS)
- $(CC) $(CFLAGS) $(LCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+ $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
lib/esd.so: $(PLUGIN_ESD)
ifneq (,$(findstring bsd,$(SYS)))
- $(CC) -shared -lesd -o $@ $^ $(LCFLAGS) -lesd
+ $(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
else
- $(CC) -shared -o $@ $^ $(LCFLAGS) -laudiofile -lesd
+ $(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
endif
lib/dsp.so: $(PLUGIN_DSP)
- $(CC) -shared -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^
lib/alsa.so: $(PLUGIN_ALSA)
- $(CC) -shared -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^
lib/null.so: $(PLUGIN_NULL)
- $(CC) -shared -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^
lib/dummy.so: $(PLUGIN_DUMMY)
- $(CC) -shared -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^
lib/fb.so: $(PLUGIN_FB)
- $(CC) -shared -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^
lib/x11.so: $(PLUGIN_X11)
- $(CC) -shared -L/usr/X11R6/lib -o $@ $^ $(LCFLAGS) -lX11 -lXext
+ $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
lib/mga.so: $(PLUGIN_MGA)
- $(CC) -shared -L/usr/X11R6/lib -o $@ $^ $(LCFLAGS) -lX11 -lXext
+ $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
lib/gnome.so: $(PLUGIN_GNOME)
- $(CC) -shared -o $@ $^ $(LCFLAGS) `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
+ $(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
lib/glide.so: $(PLUGIN_GLIDE)
- $(CC) -shared $(LIB_GLIDE) -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GLIDE)
lib/ggi.so: $(PLUGIN_GGI)
- $(CC) -shared $(LIB_GGI) -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GGI)
lib/sdl.so: $(PLUGIN_SDL)
- $(CC) -shared $(LIB_SDL) -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
lib/yuv.so: $(PLUGIN_YUV)
ifeq ($(SYS),beos)
- $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+ $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else
- $(CC) -shared -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^
endif
lib/yuvmmx.so: $(PLUGIN_YUVMMX)
ifeq ($(SYS),beos)
- $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+ $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else
- $(CC) -shared -o $@ $^ $(LCFLAGS)
+ $(CC) $(PCFLAGS) -shared -o $@ $^
endif
################################################################################
*****************************************************************************/
/* Number of tries before we unload an unused module */
-#define MODULE_HIDE_DELAY 50
+#define MODULE_HIDE_DELAY 100
/* The module handle type. */
#ifdef SYS_BEOS
*****************************************************************************/
/* Mandatory first and last parts of the structure */
-#define MODULE_CONFIG_ITEM_START 0x01 /* The main window */
-#define MODULE_CONFIG_ITEM_END 0x00 /* End of the window */
+#define MODULE_CONFIG_ITEM_START 0xdead /* The main window */
+#define MODULE_CONFIG_ITEM_END 0xbeef /* End of the window */
/* Configuration widgets */
-#define MODULE_CONFIG_ITEM_PANE 0x02 /* A notebook pane */
-#define MODULE_CONFIG_ITEM_FRAME 0x03 /* A frame */
-#define MODULE_CONFIG_ITEM_COMMENT 0x04 /* A comment text */
-#define MODULE_CONFIG_ITEM_STRING 0x05 /* A string */
-#define MODULE_CONFIG_ITEM_FILE 0x06 /* A file selector */
-#define MODULE_CONFIG_ITEM_CHECK 0x07 /* A checkbox */
-#define MODULE_CONFIG_ITEM_CHOOSE 0x08 /* A choose box */
-#define MODULE_CONFIG_ITEM_RADIO 0x09 /* A radio box */
-#define MODULE_CONFIG_ITEM_SCALE 0x0a /* A horizontal ruler */
-#define MODULE_CONFIG_ITEM_SPIN 0x0b /* A numerical selector */
+#define MODULE_CONFIG_ITEM_WINDOW 0x0001 /* The main window */
+#define MODULE_CONFIG_ITEM_PANE 0x0002 /* A notebook pane */
+#define MODULE_CONFIG_ITEM_FRAME 0x0003 /* A frame */
+#define MODULE_CONFIG_ITEM_COMMENT 0x0004 /* A comment text */
+#define MODULE_CONFIG_ITEM_STRING 0x0005 /* A string */
+#define MODULE_CONFIG_ITEM_FILE 0x0006 /* A file selector */
+#define MODULE_CONFIG_ITEM_CHECK 0x0007 /* A checkbox */
+#define MODULE_CONFIG_ITEM_CHOOSE 0x0008 /* A choose box */
+#define MODULE_CONFIG_ITEM_RADIO 0x0009 /* A radio box */
+#define MODULE_CONFIG_ITEM_SCALE 0x000a /* A horizontal ruler */
+#define MODULE_CONFIG_ITEM_SPIN 0x000b /* A numerical selector */
typedef struct module_config_s
{
* Inline functions for handling dynamic modules
*****************************************************************************/
-/* Function to load a dynamic module, returns 0 if successful. */
+/*****************************************************************************
+ * module_load: load a dynamic library
+ *****************************************************************************
+ * This function loads a dynamically linked library using a system dependant
+ * method, and returns a non-zero value on error, zero otherwise.
+ *****************************************************************************/
static __inline__ int
module_load( char * psz_filename, module_handle_t * handle )
{
#ifdef SYS_BEOS
*handle = load_add_on( psz_filename );
- return( *handle >= 0 );
+ return( *handle < 0 );
#else
- *handle = dlopen( psz_filename, RTLD_NOW | RTLD_GLOBAL );
- return( *handle != NULL );
+ /* Do not open modules with RTLD_GLOBAL, or we are going to get namespace
+ * collisions when two modules have common public symbols */
+ *handle = dlopen( psz_filename, RTLD_NOW );
+ return( *handle == NULL );
#endif
}
-/* Unload a dynamic module. */
+/*****************************************************************************
+ * module_unload: unload a dynamic library
+ *****************************************************************************
+ * This function unloads a previously opened dynamically linked library
+ * using a system dependant method. No return value is taken in consideration,
+ * since some libraries sometimes refuse to close properly.
+ *****************************************************************************/
static __inline__ void
module_unload( module_handle_t handle )
{
return;
}
-/* Get a given symbol from a module. */
+/*****************************************************************************
+ * module_getsymbol: get a symbol from a dynamic library
+ *****************************************************************************
+ * This function queries a loaded library for a symbol specified in a
+ * string, and returns a pointer to it.
+ * FIXME: under Unix we should maybe check for dlerror() instead of the
+ * return value of dlsym, since we could have loaded a symbol really set
+ * to NULL (quite unlikely, though).
+ *****************************************************************************/
static __inline__ void *
module_getsymbol( module_handle_t handle, char * psz_function )
{
#endif
}
-/* Wrapper to dlerror() for systems that don't have it. */
-static __inline__ char *
+/*****************************************************************************
+ * module_error: wrapper for dlerror()
+ *****************************************************************************
+ * This function returns the error message of the last module operation. It
+ * returns the string "failed" on systems which do not have the dlerror()
+ * function.
+ *****************************************************************************/
+static __inline__ const char *
module_error( void )
{
#ifdef SYS_BEOS
/*****************************************************************************
* Macros used to build the configuration structure.
*****************************************************************************/
-#define MODULE_CONFIG_START( text ) \
+#define MODULE_CONFIG_START \
static module_config_t p_config[] = { \
- { MODULE_CONFIG_ITEM_START, text, NULL, NULL, NULL },
+ { MODULE_CONFIG_ITEM_START, NULL, NULL, NULL, NULL },
-#define MODULE_CONFIG_END \
+#define MODULE_CONFIG_END \
{ MODULE_CONFIG_ITEM_END, NULL, NULL, NULL, NULL } \
};
+#define ADD_WINDOW( text ) \
+ { MODULE_CONFIG_ITEM_WINDOW, text, NULL, NULL, NULL },
#define ADD_FRAME( text ) \
{ MODULE_CONFIG_ITEM_FRAME, text, NULL, NULL, NULL },
#define ADD_PANE( text ) \
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-void dsp_aout_getfunctions( function_list_t * p_function_list )
+void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->p_probe = aout_Probe;
p_function_list->functions.aout.p_open = aout_Open;
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
-MODULE_CONFIG_START( "Configuration for dsp module" )
+MODULE_CONFIG_START
+ADD_WINDOW( "Configuration for dsp module" )
ADD_FRAME( "OSS Device" )
ADD_FILE( "Device name: ", MODULE_VAR(device), NULL )
MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
-void dsp_aout_getfunctions( function_list_t * p_function_list );
+extern void aout_getfunctions( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
return( -1 );
}
- dsp_aout_getfunctions( &p_module->p_functions->aout );
+ aout_getfunctions( &p_module->p_functions->aout );
p_module->p_config = p_config;
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-void esd_aout_getfunctions( function_list_t * p_function_list )
+void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->p_probe = aout_Probe;
p_function_list->functions.aout.p_open = aout_Open;
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
-MODULE_CONFIG_START( "Configuration for esd module" )
+MODULE_CONFIG_START
+ADD_WINDOW( "Configuration for esd module" )
ADD_FRAME( "EsounD" )
ADD_COMMENT( "This module does not need configuration" )
MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
-void esd_aout_getfunctions( function_list_t * p_function_list );
+extern void aout_getfunctions( function_list_t * p_function_list );
/*****************************************************************************
* InitModule: get the module structure and configuration.
return( -1 );
}
- esd_aout_getfunctions( &p_module->p_functions->aout );
+ aout_getfunctions( &p_module->p_functions->aout );
p_module->p_config = p_config;
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
-MODULE_CONFIG_START( "Configuration for null module" )
+MODULE_CONFIG_START
+ADD_WINDOW( "Configuration for null module" )
ADD_PANE( "First pane" )
ADD_FRAME( "First frame" )
ADD_COMMENT( "You can put whatever you want here." )
module_handle_t handle;
/* Try to dynamically load the module. */
- if( ! module_load( psz_filename, &handle ) )
+ if( module_load( psz_filename, &handle ) )
{
/* The dynamic module couldn't be opened */
- intf_DbgMsg( "module error: cannot open %s (%s)",
+ intf_DbgMsg( "module warning: cannot open %s (%s)",
psz_filename, module_error() );
return( -1 );
}
}
/* i_usage == -1, which means that the module isn't in memory */
- if( ! module_load( p_module->psz_filename, &p_module->handle ) )
+ if( module_load( p_module->psz_filename, &p_module->handle ) )
{
/* The dynamic module couldn't be opened */
intf_ErrMsg( "module error: cannot open %s (%s)",
}
close( i_fd );
- *p_plugin_id = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL );
+ *p_plugin_id = dlopen( psz_plugin, RTLD_NOW );
#endif
#ifdef SYS_BEOS