static plugins (--with-static-plugins to force on, --without-static-plugins

to force off, defaults to off for *nix and on for win32). does not work yet
due to lack of support in libs/util/plugin.c, but that's next.
This commit is contained in:
Bill Currie 2001-10-10 05:52:14 +00:00
parent 1674e6a763
commit eee1aaf283
9 changed files with 110 additions and 7 deletions

View file

@ -133,5 +133,17 @@
/* Define this if you want progs typechecking */
#undef TYPECHECK_PROGS
/* list of cd plugins and prototypes */
#undef CD_PLUGIN_LIST
#undef CD_PLUGIN_PROTOS
/* list of sound output plugins and prototypes */
#undef SND_OUTPUT_LIST
#undef SND_OUTPUT_PROTOS
/* list of sound render plugins and prototypes */
#undef SND_RENDER_LIST
#undef SND_RENDER_PROTOS
@BOTTOM@
#endif // __config_h_

View file

@ -1544,12 +1544,74 @@ else
SOUND_TYPES=""
fi
CD_PLUGIN_STATIC=""
SND_PLUGIN_STATIC=""
SND_REND_STATIC=""
AC_ARG_WITH(static-plugins,
[ --with-static-plugins build plugins into executable rather than separate],
static_plugins="$withval", static_plugins=auto)
if test "x$static_plugins" = xauto -a "x$SYSTYPE" = xWIN32; then
static_plugins=yes
fi
if test "x$static_plugins" = xyes; then
CD_PLUGIN_STATIC="$CD_PLUGIN_TARGETS"
CD_PLUGIN_TARGETS=""
SND_PLUGIN_STATIC="$SND_PLUGIN_TARGETS"
SND_PLUGIN_TARGETS=""
SND_REND_STATIC="$SND_REND_TARGETS"
SND_REND_TARGETS=""
if test -n "$SOUND_TYPES"; then
SOUND_TYPES="$SOUND_TYPES (static)"
CDTYPE="$CDTYPE (static)"
fi
fi
CD_PLUGIN_STATIC_LIBS=""
SND_PLUGIN_STATIC_LIBS=""
SND_REND_STATIC_LIBS=""
CD_PLUGIN_LIST="{0, 0}"
SND_OUTPUT_LIST="{0, 0}"
SND_RENDER_LIST="{0, 0}"
CD_PLUGIN_PROTOS=""
SND_OUTPUT_PROTOS=""
SND_RENDER_PROTOS=""
for l in $CD_PLUGIN_STATIC; do
CD_PLUGIN_STATIC_LIBS="$CD_PLUGIN_STATIC_LIBS cd/$l"
n="`echo $l | sed -e 's/lib\(.*\)\.la/\1/'`"
CD_PLUGIN_LIST='{"'"$n"'"'", ${n}_PluginInfo},$CD_PLUGIN_LIST"
CD_PLUGIN_PROTOS="$CD_PLUGIN_PROTOS extern QFPLUGIN plugin_t *${n}_PluginInfo (void);"
done
for l in $SND_PLUGIN_STATIC; do
SND_PLUGIN_STATIC_LIBS="$SND_PLUGIN_STATIC_LIBS targets/$l"
n="`echo $l | sed -e 's/lib\(.*\)\.la/\1/'`"
SND_OUTPUT_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SND_OUTPUT_LIST"
SND_OUTPUT_PROTOS="$SND_OUTPUT_PROTOS extern QFPLUGIN plugin_t *${n}_PluginInfo (void);"
done
for l in $SND_REND_STATIC; do
SND_REND_STATIC_LIBS="$SND_REND_STATIC_LIBS renderer/$l"
n="`echo $l | sed -e 's/lib\(.*\)\.la/\1/'`"
SND_RENDER_LIST='{"'"$n"'"'", ${n}_PluginInfo},$SND_RENDER_LIST"
SND_RENDER_PROTOS="$SND_RENDER_PROTOS extern QFPLUGIN plugin_t *${n}_PluginInfo (void);"
done
AC_DEFINE_UNQUOTED(CD_PLUGIN_LIST, $CD_PLUGIN_LIST)
AC_DEFINE_UNQUOTED(CD_PLUGIN_PROTOS, $CD_PLUGIN_PROTOS)
AC_DEFINE_UNQUOTED(SND_OUTPUT_LIST, $SND_OUTPUT_LIST)
AC_DEFINE_UNQUOTED(SND_OUTPUT_PROTOS, $SND_OUTPUT_PROTOS)
AC_DEFINE_UNQUOTED(SND_RENDER_LIST, $SND_RENDER_LIST)
AC_DEFINE_UNQUOTED(SND_RENDER_PROTOS, $SND_RENDER_PROTOS)
AC_SUBST(NQ_TARGETS)
AC_SUBST(QW_TARGETS)
AC_SUBST(CD_PLUGIN_TARGETS)
AC_SUBST(CD_PLUGIN_STATIC)
AC_SUBST(CD_PLUGIN_STATIC_LIBS)
AC_SUBST(CD_TARGETS)
AC_SUBST(SND_PLUGIN_TARGETS)
AC_SUBST(SND_PLUGIN_STATIC)
AC_SUBST(SND_PLUGIN_STATIC_LIBS)
AC_SUBST(SND_REND_TARGETS)
AC_SUBST(SND_REND_STATIC)
AC_SUBST(SND_REND_STATIC_LIBS)
AC_SUBST(SND_TARGETS)
AC_SUBST(VID_MODEL_TARGETS)
AC_SUBST(VID_REND_TARGETS)

View file

@ -92,6 +92,11 @@ typedef struct plugin_s {
*/
typedef plugin_t * (*P_PluginInfo) (void);
typedef struct plugin_list_s {
const char *name;
P_PluginInfo info;
} plugin_list_t;
/*
Plugin system variables
*/

View file

@ -5,7 +5,11 @@ lib_LTLIBRARIES= @CD_TARGETS@ @SND_TARGETS@
EXTRA_LTLIBRARIES= libQFsound.la libQFcd.la
libQFsound_la_LDFLAGS= -version-info 1:0:0 -rpath $(libdir)
libQFsound_la_LIBADD= @SND_PLUGIN_STATIC_LIBS@ @SND_REND_STATIC_LIBS@
libQFsound_la_SOURCES= snd.c
libQFsound_la_DEPENDENCIES= @SND_PLUGIN_STATIC_LIBS@ @SND_REND_STATIC_LIBS@
libQFcd_la_LDFLAGS= -version-info 1:0:0 -rpath $(libdir)
libQFcd_la_LIBADD= @CD_PLUGIN_STATIC_LIBS@
libQFcd_la_SOURCES= cd.c
libQFcd_la_DEPENDENCIES= @CD_PLUGIN_STATIC_LIBS@

View file

@ -40,9 +40,13 @@ static const char rcsid[] =
#include "QF/qtypes.h"
#include "QF/sys.h"
cvar_t *cd_plugin;
plugin_t *cdmodule = NULL;
cvar_t *cd_plugin;
plugin_t *cdmodule = NULL;
CD_PLUGIN_PROTOS
plugin_list_t cd_plugin_list[] = {
CD_PLUGIN_LIST
};
void
CDAudio_Pause (void)

View file

@ -4,6 +4,7 @@ XMMS_LIBS = @XMMS_LIBS@
plugin_LTLIBRARIES= @CD_PLUGIN_TARGETS@
noinst_LTLIBRARIES= @CD_PLUGIN_STATIC@
EXTRA_LTLIBRARIES= libcd_linux.la libcd_sdl.la libcd_sgi.la libcd_win.la libcd_null.la libcd_xmms.la
libcd_linux_la_LDFLAGS= -version-info 1:0:0 -rpath $(plugindir)

View file

@ -9,7 +9,7 @@ else
asm=
endif
noinst_LTLIBRARIES= $(asm)
noinst_LTLIBRARIES= $(asm) @SND_REND_STATIC@
libasm_la_SOURCES= snd_mixa.S

View file

@ -29,6 +29,10 @@
static const char rcsid[] =
"$Id$";
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "QF/cvar.h"
#include "QF/sound.h"
#include "QF/model.h"
@ -50,10 +54,20 @@ cvar_t *bgmvolume;
cvar_t *volume;
cvar_t *snd_interp;
cvar_t *snd_output;
cvar_t *snd_render;
plugin_t *snd_render_module = NULL;
plugin_t *snd_output_module = NULL;
cvar_t *snd_output;
cvar_t *snd_render;
plugin_t *snd_render_module = NULL;
plugin_t *snd_output_module = NULL;
SND_OUTPUT_PROTOS
plugin_list_t snd_output_list[] = {
SND_OUTPUT_LIST
};
SND_RENDER_PROTOS
plugin_list_t snd_render_list[] = {
SND_RENDER_LIST
};
// FIXME: ewwwies
extern double host_frametime; // From host.h

View file

@ -2,6 +2,7 @@ INCLUDES= -I$(top_srcdir)/include $(ALSA_CFLAGS) $(MME_CFLAGS) $(OSS_CFLAGS) $(S
SDL_LIBS = @SDL_LIBS@
plugin_LTLIBRARIES = @SND_PLUGIN_TARGETS@
noinst_LTLIBRARIES = @SND_PLUGIN_STATIC@
EXTRA_LTLIBRARIES = libsnd_output_sdl.la libsnd_output_alsa0_5.la libsnd_output_alsa0_9.la libsnd_output_oss.la libsnd_output_sgi.la libsnd_output_sun.la libsnd_output_win.la libsnd_output_null.la libsnd_output_disk.la
libsnd_output_sdl_la_LDFLAGS= $(plugin_LDFLAGS) -version-info 1:0:0 -rpath $(plugindir)