BUILT_SOURCES += \
stamp-api \
src/misc/modules_builtin.h \
+ src/misc/version.c \
$(NULL)
pkgincludedir = $(includedir)/vlc
srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
touch $@
+src/misc/version.c: FORCE
+ srcdir=$(srcdir) $(srcdir)/toolbox --update-version
+
# These dependencies are mandatory
$(SOURCES_libvlc): src/misc/modules_builtin.h $(LIB_intl)
src/misc/getaddrinfo.c \
src/misc/vlm.c \
src/misc/xml.c \
+ src/misc/version.c \
src/extras/libc.c \
src/control/core.c \
src/control/util.c \
/*****************************************************************************
* Exported libvlc API
*****************************************************************************/
-
+#if !defined( __VLC__ )
+/* Otherwise they are declared and exported in vlc_common.h */
/**
* Retrieve libvlc version
*
*/
char const * VLC_Version ( void );
+/**
+ * Retrieve libvlc compile time
+ *
+ * \return a string containing the libvlc compile time
+ */
+char const * VLC_CompileTime ( void );
+
+/**
+ * Retrieve the username of the libvlc builder
+ *
+ * \return a string containing the username of the libvlc builder
+ */
+char const * VLC_CompileBy ( void );
+
+/**
+ * Retrieve the host of the libvlc builder
+ *
+ * \return a string containing the host of the libvlc builder
+ */
+char const * VLC_CompileHost ( void );
+
+/**
+ * Retrieve the domain name of the host of the libvlc builder
+ *
+ * \return a string containing the domain name of the host of the libvlc builder
+ */
+char const * VLC_CompileDomain ( void );
+
+/**
+ * Retrieve libvlc compiler version
+ *
+ * \return a string containing the libvlc compiler version
+ */
+char const * VLC_Compiler ( void );
+
+/**
+ * Retrieve libvlc changeset
+ *
+ * \return a string containing the libvlc subversion changeset
+ */
+char const * VLC_Changeset ( void );
+
/**
* Return an error string
*
*/
char const * VLC_Error ( int i_err );
+#endif /* __VLC__ */
+
/**
* Initialize libvlc
*
# define N_(String) ((char*)(String))
#endif
+/*****************************************************************************
+ * libvlc features
+ *****************************************************************************/
+VLC_EXPORT( const char *, VLC_Version, ( void ) );
+VLC_EXPORT( const char *, VLC_CompileTime, ( void ) );
+VLC_EXPORT( const char *, VLC_CompileBy, ( void ) );
+VLC_EXPORT( const char *, VLC_CompileHost, ( void ) );
+VLC_EXPORT( const char *, VLC_CompileDomain, ( void ) );
+VLC_EXPORT( const char *, VLC_Compiler, ( void ) );
+VLC_EXPORT( const char *, VLC_Changeset, ( void ) );
+VLC_EXPORT( const char *, VLC_Error, ( int ) );
+
/*****************************************************************************
* Additional vlc stuff
*****************************************************************************/
void *__osd_VolumeUp_deprecated;
void (*__osd_MenuActivate_inner) (vlc_object_t *);
void (*__osd_Volume_inner) (vlc_object_t *);
+ const char * (*VLC_Compiler_inner) (void);
+ const char * (*VLC_Error_inner) (int);
+ const char * (*VLC_Changeset_inner) (void);
+ const char * (*VLC_CompileBy_inner) (void);
+ const char * (*VLC_CompileDomain_inner) (void);
+ const char * (*VLC_CompileHost_inner) (void);
+ const char * (*VLC_Version_inner) (void);
+ const char * (*VLC_CompileTime_inner) (void);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
# define __osd_MenuPrev (p_symbols)->__osd_MenuPrev_inner
# define __osd_MenuActivate (p_symbols)->__osd_MenuActivate_inner
# define __osd_Volume (p_symbols)->__osd_Volume_inner
+# define VLC_Compiler (p_symbols)->VLC_Compiler_inner
+# define VLC_Error (p_symbols)->VLC_Error_inner
+# define VLC_Changeset (p_symbols)->VLC_Changeset_inner
+# define VLC_CompileBy (p_symbols)->VLC_CompileBy_inner
+# define VLC_CompileDomain (p_symbols)->VLC_CompileDomain_inner
+# define VLC_CompileHost (p_symbols)->VLC_CompileHost_inner
+# define VLC_Version (p_symbols)->VLC_Version_inner
+# define VLC_CompileTime (p_symbols)->VLC_CompileTime_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
((p_symbols)->__osd_MenuPrev_inner) = __osd_MenuPrev; \
((p_symbols)->__osd_MenuActivate_inner) = __osd_MenuActivate; \
((p_symbols)->__osd_Volume_inner) = __osd_Volume; \
+ ((p_symbols)->VLC_Compiler_inner) = VLC_Compiler; \
+ ((p_symbols)->VLC_Error_inner) = VLC_Error; \
+ ((p_symbols)->VLC_Changeset_inner) = VLC_Changeset; \
+ ((p_symbols)->VLC_CompileBy_inner) = VLC_CompileBy; \
+ ((p_symbols)->VLC_CompileDomain_inner) = VLC_CompileDomain; \
+ ((p_symbols)->VLC_CompileHost_inner) = VLC_CompileHost; \
+ ((p_symbols)->VLC_Version_inner) = VLC_Version; \
+ ((p_symbols)->VLC_CompileTime_inner) = VLC_CompileTime; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->vlc_fix_readdir_charset_deprecated = NULL; \
(p_symbols)->__osd_VolumeDown_deprecated = NULL; \
sprintf( volume , "%d" , (int)i_volume );
p_args->vars = mvar_New( "variables", "" );
- mvar_AppendNewVar( p_args->vars, "url_param", i_request > 0 ? "1" : "0" );
+ mvar_AppendNewVar( p_args->vars, "url_param",
+ i_request > 0 ? "1" : "0" );
mvar_AppendNewVar( p_args->vars, "url_value", p_request );
- mvar_AppendNewVar( p_args->vars, "version", VERSION_MESSAGE );
+ mvar_AppendNewVar( p_args->vars, "version", VLC_Version() );
mvar_AppendNewVar( p_args->vars, "copyright", COPYRIGHT_MESSAGE );
+ mvar_AppendNewVar( p_args->vars, "vlc_compile_time",
+ VLC_CompileTime() );
+ mvar_AppendNewVar( p_args->vars, "vlc_compile_by", VLC_CompileBy() );
+ mvar_AppendNewVar( p_args->vars, "vlc_compile_host",
+ VLC_CompileHost() );
+ mvar_AppendNewVar( p_args->vars, "vlc_compile_domain",
+ VLC_CompileDomain() );
+ mvar_AppendNewVar( p_args->vars, "vlc_compiler", VLC_Compiler() );
+ mvar_AppendNewVar( p_args->vars, "vlc_changeset", VLC_Changeset() );
mvar_AppendNewVar( p_args->vars, "stream_position", position );
mvar_AppendNewVar( p_args->vars, "stream_time", time );
mvar_AppendNewVar( p_args->vars, "stream_length", length );
return VERSION_MESSAGE;
}
+/*****************************************************************************
+ * VLC_CompileTime, VLC_CompileBy, VLC_CompileHost, VLC_CompileDomain,
+ * VLC_Compiler, VLC_Changeset
+ *****************************************************************************/
+#define DECLARE_VLC_VERSION( func, var ) \
+extern const char psz_vlc_##var []; \
+char const * VLC_##func ( void ) \
+{ \
+ return psz_vlc_##var ; \
+}
+
+DECLARE_VLC_VERSION( CompileTime, compile_time );
+DECLARE_VLC_VERSION( CompileBy, compile_by );
+DECLARE_VLC_VERSION( CompileHost, compile_host );
+DECLARE_VLC_VERSION( CompileDomain, compile_domain );
+DECLARE_VLC_VERSION( Compiler, compiler );
+DECLARE_VLC_VERSION( Changeset, changeset );
+
/*****************************************************************************
* VLC_Error: strerror() equivalent
*****************************************************************************
ShowConsole();
#endif
- fprintf( stdout, VERSION_MESSAGE "\n" );
+ fprintf( stdout, _("VLC version %s\n"), VLC_Version() );
+ fprintf( stdout, _("Compiled on %s by %s@%s.%s\n"), VLC_CompileTime(),
+ VLC_CompileBy(), VLC_CompileHost(), VLC_CompileDomain() );
+ fprintf( stdout, _("Compiler: %s\n"), VLC_Compiler() );
+ if( *VLC_Changeset() )
+ fprintf( stdout, _("Based upon svn changeset [%s]\n"),
+ VLC_Changeset() );
fprintf( stdout,
_("This program comes with NO WARRANTY, to the extent permitted by "
"law.\nYou may redistribute it under the terms of the GNU General "
--update-vc update Microsoft Visual Studio files
--update-po update translation files
--update-includes generate various include files
+ --update-version generate src/misc/version.c
--update-glade generate and fix Glade code
--update-glade2 generate and fix Glade 2 code
--update-flexml generate and fix flexml and flex code
--update-includes)
action=includes
;;
+ --update-version)
+ action=version
+ ;;
--update-flexml)
action=flexml
;;
exit 0
fi
+##
+## Create version file
+##
+if test "${action}" = "version"
+then
+ if test -z "${srcdir}"; then
+ srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
+ fi
+ if test -z "${builddir}"; then
+ builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`"
+ fi
+ if test -z "${CC}"; then
+ CC="`sed -ne 's/^CC *= *//p' < Makefile`"
+ fi
+
+ VLC_COMPILE_TIME=`LC_ALL=C LANG=C date`
+ VLC_COMPILE_BY=`whoami`
+ VLC_COMPILE_HOST=`hostname`
+ if which dnsdomainname 2>&1 >/dev/null; then
+ VLC_COMPILE_DOMAIN=`dnsdomainname`
+ elif which domainname 2>&1 >/dev/null; then
+ VLC_COMPILE_DOMAIN=`domainname`
+ else
+ VLC_COMPILE_DOMAIN=unknown
+ fi
+ VLC_COMPILER=`$CC -v 2>&1 | tail -n 1`
+ if which svnversion 2>&1 >/dev/null; then
+ VLC_CHANGESET=`svnversion $srcdir`
+ else
+ VLC_CHANGESET=''
+ fi
+
+ cat >| src/misc/version.c << EOF
+const char psz_vlc_compile_time[] = "${VLC_COMPILE_TIME}";
+const char psz_vlc_compile_by[] = "${VLC_COMPILE_BY}";
+const char psz_vlc_compile_host[] = "${VLC_COMPILE_HOST}";
+const char psz_vlc_compile_domain[] = "${VLC_COMPILE_DOMAIN}";
+const char psz_vlc_compiler[] = "${VLC_COMPILER}";
+const char psz_vlc_changeset[] = "${VLC_CHANGESET}";
+EOF
+fi
+
##
## Fix glade-generated files
##