Changeset 2851705c32f14a69dcf115859481f0e4267d9ac2
- Timestamp:
- 08/17/05 16:39:07
(3 years ago)
- Author:
- Christophe Massiot <massiot@videolan.org>
- git-committer:
- Christophe Massiot <massiot@videolan.org> 1124289547 +0000
- git-parent:
[606657480ad9bf46664eea80f2a8e49aabc02d37]
- git-author:
- Christophe Massiot <massiot@videolan.org> 1124289547 +0000
- Message:
- Makefile.am: New file version.c, generated at each 'make' command.
- toolbox: New --update-version switch, which builds the version.c file
from current date, user/hostname/domainname, compiler version and
svn changeset.
- src/libvlc.c: Exported API to access data from version.c.
- modules/control/http.c: New variables vlc_compile_time, vlc_compile_by,
vlc_compile_host, vlc_compile_domain, vlc_compiler and vlc_changeset.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5b85463 |
r2851705 |
|
| 49 | 49 | stamp-api \ |
|---|
| 50 | 50 | src/misc/modules_builtin.h \ |
|---|
| | 51 | src/misc/version.c \ |
|---|
| 51 | 52 | $(NULL) |
|---|
| 52 | 53 | |
|---|
| … | … | |
| 131 | 132 | srcdir=$(srcdir) $(srcdir)/toolbox --update-includes |
|---|
| 132 | 133 | touch $@ |
|---|
| | 134 | |
|---|
| | 135 | src/misc/version.c: FORCE |
|---|
| | 136 | srcdir=$(srcdir) $(srcdir)/toolbox --update-version |
|---|
| 133 | 137 | |
|---|
| 134 | 138 | # These dependencies are mandatory |
|---|
| … | … | |
| 413 | 417 | src/misc/vlm.c \ |
|---|
| 414 | 418 | src/misc/xml.c \ |
|---|
| | 419 | src/misc/version.c \ |
|---|
| 415 | 420 | src/extras/libc.c \ |
|---|
| 416 | 421 | src/control/core.c \ |
|---|
| rfe087a3 |
r2851705 |
|
| 153 | 153 | * Exported libvlc API |
|---|
| 154 | 154 | *****************************************************************************/ |
|---|
| 155 | | |
|---|
| | 155 | #if !defined( __VLC__ ) |
|---|
| | 156 | /* Otherwise they are declared and exported in vlc_common.h */ |
|---|
| 156 | 157 | /** |
|---|
| 157 | 158 | * Retrieve libvlc version |
|---|
| … | … | |
| 160 | 161 | */ |
|---|
| 161 | 162 | char const * VLC_Version ( void ); |
|---|
| | 163 | |
|---|
| | 164 | /** |
|---|
| | 165 | * Retrieve libvlc compile time |
|---|
| | 166 | * |
|---|
| | 167 | * \return a string containing the libvlc compile time |
|---|
| | 168 | */ |
|---|
| | 169 | char const * VLC_CompileTime ( void ); |
|---|
| | 170 | |
|---|
| | 171 | /** |
|---|
| | 172 | * Retrieve the username of the libvlc builder |
|---|
| | 173 | * |
|---|
| | 174 | * \return a string containing the username of the libvlc builder |
|---|
| | 175 | */ |
|---|
| | 176 | char const * VLC_CompileBy ( void ); |
|---|
| | 177 | |
|---|
| | 178 | /** |
|---|
| | 179 | * Retrieve the host of the libvlc builder |
|---|
| | 180 | * |
|---|
| | 181 | * \return a string containing the host of the libvlc builder |
|---|
| | 182 | */ |
|---|
| | 183 | char const * VLC_CompileHost ( void ); |
|---|
| | 184 | |
|---|
| | 185 | /** |
|---|
| | 186 | * Retrieve the domain name of the host of the libvlc builder |
|---|
| | 187 | * |
|---|
| | 188 | * \return a string containing the domain name of the host of the libvlc builder |
|---|
| | 189 | */ |
|---|
| | 190 | char const * VLC_CompileDomain ( void ); |
|---|
| | 191 | |
|---|
| | 192 | /** |
|---|
| | 193 | * Retrieve libvlc compiler version |
|---|
| | 194 | * |
|---|
| | 195 | * \return a string containing the libvlc compiler version |
|---|
| | 196 | */ |
|---|
| | 197 | char const * VLC_Compiler ( void ); |
|---|
| | 198 | |
|---|
| | 199 | /** |
|---|
| | 200 | * Retrieve libvlc changeset |
|---|
| | 201 | * |
|---|
| | 202 | * \return a string containing the libvlc subversion changeset |
|---|
| | 203 | */ |
|---|
| | 204 | char const * VLC_Changeset ( void ); |
|---|
| 162 | 205 | |
|---|
| 163 | 206 | /** |
|---|
| … | … | |
| 168 | 211 | */ |
|---|
| 169 | 212 | char const * VLC_Error ( int i_err ); |
|---|
| | 213 | |
|---|
| | 214 | #endif /* __VLC__ */ |
|---|
| 170 | 215 | |
|---|
| 171 | 216 | /** |
|---|
| r26e6004 |
r2851705 |
|
| 1088 | 1088 | |
|---|
| 1089 | 1089 | /***************************************************************************** |
|---|
| | 1090 | * libvlc features |
|---|
| | 1091 | *****************************************************************************/ |
|---|
| | 1092 | VLC_EXPORT( const char *, VLC_Version, ( void ) ); |
|---|
| | 1093 | VLC_EXPORT( const char *, VLC_CompileTime, ( void ) ); |
|---|
| | 1094 | VLC_EXPORT( const char *, VLC_CompileBy, ( void ) ); |
|---|
| | 1095 | VLC_EXPORT( const char *, VLC_CompileHost, ( void ) ); |
|---|
| | 1096 | VLC_EXPORT( const char *, VLC_CompileDomain, ( void ) ); |
|---|
| | 1097 | VLC_EXPORT( const char *, VLC_Compiler, ( void ) ); |
|---|
| | 1098 | VLC_EXPORT( const char *, VLC_Changeset, ( void ) ); |
|---|
| | 1099 | VLC_EXPORT( const char *, VLC_Error, ( int ) ); |
|---|
| | 1100 | |
|---|
| | 1101 | /***************************************************************************** |
|---|
| 1090 | 1102 | * Additional vlc stuff |
|---|
| 1091 | 1103 | *****************************************************************************/ |
|---|
| r28caec4 |
r2851705 |
|
| 409 | 409 | void (*__osd_MenuActivate_inner) (vlc_object_t *); |
|---|
| 410 | 410 | void (*__osd_Volume_inner) (vlc_object_t *); |
|---|
| | 411 | const char * (*VLC_Compiler_inner) (void); |
|---|
| | 412 | const char * (*VLC_Error_inner) (int); |
|---|
| | 413 | const char * (*VLC_Changeset_inner) (void); |
|---|
| | 414 | const char * (*VLC_CompileBy_inner) (void); |
|---|
| | 415 | const char * (*VLC_CompileDomain_inner) (void); |
|---|
| | 416 | const char * (*VLC_CompileHost_inner) (void); |
|---|
| | 417 | const char * (*VLC_Version_inner) (void); |
|---|
| | 418 | const char * (*VLC_CompileTime_inner) (void); |
|---|
| 411 | 419 | }; |
|---|
| 412 | 420 | # if defined (__PLUGIN__) |
|---|
| … | … | |
| 799 | 807 | # define __osd_MenuActivate (p_symbols)->__osd_MenuActivate_inner |
|---|
| 800 | 808 | # define __osd_Volume (p_symbols)->__osd_Volume_inner |
|---|
| | 809 | # define VLC_Compiler (p_symbols)->VLC_Compiler_inner |
|---|
| | 810 | # define VLC_Error (p_symbols)->VLC_Error_inner |
|---|
| | 811 | # define VLC_Changeset (p_symbols)->VLC_Changeset_inner |
|---|
| | 812 | # define VLC_CompileBy (p_symbols)->VLC_CompileBy_inner |
|---|
| | 813 | # define VLC_CompileDomain (p_symbols)->VLC_CompileDomain_inner |
|---|
| | 814 | # define VLC_CompileHost (p_symbols)->VLC_CompileHost_inner |
|---|
| | 815 | # define VLC_Version (p_symbols)->VLC_Version_inner |
|---|
| | 816 | # define VLC_CompileTime (p_symbols)->VLC_CompileTime_inner |
|---|
| 801 | 817 | # elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__) |
|---|
| 802 | 818 | /****************************************************************** |
|---|
| … | … | |
| 1192 | 1208 | ((p_symbols)->__osd_MenuActivate_inner) = __osd_MenuActivate; \ |
|---|
| 1193 | 1209 | ((p_symbols)->__osd_Volume_inner) = __osd_Volume; \ |
|---|
| | 1210 | ((p_symbols)->VLC_Compiler_inner) = VLC_Compiler; \ |
|---|
| | 1211 | ((p_symbols)->VLC_Error_inner) = VLC_Error; \ |
|---|
| | 1212 | ((p_symbols)->VLC_Changeset_inner) = VLC_Changeset; \ |
|---|
| | 1213 | ((p_symbols)->VLC_CompileBy_inner) = VLC_CompileBy; \ |
|---|
| | 1214 | ((p_symbols)->VLC_CompileDomain_inner) = VLC_CompileDomain; \ |
|---|
| | 1215 | ((p_symbols)->VLC_CompileHost_inner) = VLC_CompileHost; \ |
|---|
| | 1216 | ((p_symbols)->VLC_Version_inner) = VLC_Version; \ |
|---|
| | 1217 | ((p_symbols)->VLC_CompileTime_inner) = VLC_CompileTime; \ |
|---|
| 1194 | 1218 | (p_symbols)->net_ConvertIPv4_deprecated = NULL; \ |
|---|
| 1195 | 1219 | (p_symbols)->vlc_fix_readdir_charset_deprecated = NULL; \ |
|---|
| r6066574 |
r2851705 |
|
| 3044 | 3044 | |
|---|
| 3045 | 3045 | p_args->vars = mvar_New( "variables", "" ); |
|---|
| 3046 | | mvar_AppendNewVar( p_args->vars, "url_param", i_request > 0 ? "1" : "0" ); |
|---|
| | 3046 | mvar_AppendNewVar( p_args->vars, "url_param", |
|---|
| | 3047 | i_request > 0 ? "1" : "0" ); |
|---|
| 3047 | 3048 | mvar_AppendNewVar( p_args->vars, "url_value", p_request ); |
|---|
| 3048 | | mvar_AppendNewVar( p_args->vars, "version", VERSION_MESSAGE ); |
|---|
| | 3049 | mvar_AppendNewVar( p_args->vars, "version", VLC_Version() ); |
|---|
| 3049 | 3050 | mvar_AppendNewVar( p_args->vars, "copyright", COPYRIGHT_MESSAGE ); |
|---|
| | 3051 | mvar_AppendNewVar( p_args->vars, "vlc_compile_time", |
|---|
| | 3052 | VLC_CompileTime() ); |
|---|
| | 3053 | mvar_AppendNewVar( p_args->vars, "vlc_compile_by", VLC_CompileBy() ); |
|---|
| | 3054 | mvar_AppendNewVar( p_args->vars, "vlc_compile_host", |
|---|
| | 3055 | VLC_CompileHost() ); |
|---|
| | 3056 | mvar_AppendNewVar( p_args->vars, "vlc_compile_domain", |
|---|
| | 3057 | VLC_CompileDomain() ); |
|---|
| | 3058 | mvar_AppendNewVar( p_args->vars, "vlc_compiler", VLC_Compiler() ); |
|---|
| | 3059 | mvar_AppendNewVar( p_args->vars, "vlc_changeset", VLC_Changeset() ); |
|---|
| 3050 | 3060 | mvar_AppendNewVar( p_args->vars, "stream_position", position ); |
|---|
| 3051 | 3061 | mvar_AppendNewVar( p_args->vars, "stream_time", time ); |
|---|
| ra3eb885 |
r2851705 |
|
| 138 | 138 | return VERSION_MESSAGE; |
|---|
| 139 | 139 | } |
|---|
| | 140 | |
|---|
| | 141 | /***************************************************************************** |
|---|
| | 142 | * VLC_CompileTime, VLC_CompileBy, VLC_CompileHost, VLC_CompileDomain, |
|---|
| | 143 | * VLC_Compiler, VLC_Changeset |
|---|
| | 144 | *****************************************************************************/ |
|---|
| | 145 | #define DECLARE_VLC_VERSION( func, var ) \ |
|---|
| | 146 | extern const char psz_vlc_##var []; \ |
|---|
| | 147 | char const * VLC_##func ( void ) \ |
|---|
| | 148 | { \ |
|---|
| | 149 | return psz_vlc_##var ; \ |
|---|
| | 150 | } |
|---|
| | 151 | |
|---|
| | 152 | DECLARE_VLC_VERSION( CompileTime, compile_time ); |
|---|
| | 153 | DECLARE_VLC_VERSION( CompileBy, compile_by ); |
|---|
| | 154 | DECLARE_VLC_VERSION( CompileHost, compile_host ); |
|---|
| | 155 | DECLARE_VLC_VERSION( CompileDomain, compile_domain ); |
|---|
| | 156 | DECLARE_VLC_VERSION( Compiler, compiler ); |
|---|
| | 157 | DECLARE_VLC_VERSION( Changeset, changeset ); |
|---|
| 140 | 158 | |
|---|
| 141 | 159 | /***************************************************************************** |
|---|
| … | … | |
| 2361 | 2379 | #endif |
|---|
| 2362 | 2380 | |
|---|
| 2363 | | fprintf( stdout, VERSION_MESSAGE "\n" ); |
|---|
| | 2381 | fprintf( stdout, _("VLC version %s\n"), VLC_Version() ); |
|---|
| | 2382 | fprintf( stdout, _("Compiled on %s by %s@%s.%s\n"), VLC_CompileTime(), |
|---|
| | 2383 | VLC_CompileBy(), VLC_CompileHost(), VLC_CompileDomain() ); |
|---|
| | 2384 | fprintf( stdout, _("Compiler: %s\n"), VLC_Compiler() ); |
|---|
| | 2385 | if( *VLC_Changeset() ) |
|---|
| | 2386 | fprintf( stdout, _("Based upon svn changeset [%s]\n"), |
|---|
| | 2387 | VLC_Changeset() ); |
|---|
| 2364 | 2388 | fprintf( stdout, |
|---|
| 2365 | 2389 | _("This program comes with NO WARRANTY, to the extent permitted by " |
|---|
| rc8c6021 |
r2851705 |
|
| 29 | 29 | --update-po update translation files |
|---|
| 30 | 30 | --update-includes generate various include files |
|---|
| | 31 | --update-version generate src/misc/version.c |
|---|
| 31 | 32 | --update-glade generate and fix Glade code |
|---|
| 32 | 33 | --update-glade2 generate and fix Glade 2 code |
|---|
| … | … | |
| 71 | 72 | --update-includes) |
|---|
| 72 | 73 | action=includes |
|---|
| | 74 | ;; |
|---|
| | 75 | --update-version) |
|---|
| | 76 | action=version |
|---|
| 73 | 77 | ;; |
|---|
| 74 | 78 | --update-flexml) |
|---|
| … | … | |
| 427 | 431 | |
|---|
| 428 | 432 | ## |
|---|
| | 433 | ## Create version file |
|---|
| | 434 | ## |
|---|
| | 435 | if test "${action}" = "version" |
|---|
| | 436 | then |
|---|
| | 437 | if test -z "${srcdir}"; then |
|---|
| | 438 | srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`" |
|---|
| | 439 | fi |
|---|
| | 440 | if test -z "${builddir}"; then |
|---|
| | 441 | builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`" |
|---|
| | 442 | fi |
|---|
| | 443 | if test -z "${CC}"; then |
|---|
| | 444 | CC="`sed -ne 's/^CC *= *//p' < Makefile`" |
|---|
| | 445 | fi |
|---|
| | 446 | |
|---|
| | 447 | VLC_COMPILE_TIME=`LC_ALL=C LANG=C date` |
|---|
| | 448 | VLC_COMPILE_BY=`whoami` |
|---|
| | 449 | VLC_COMPILE_HOST=`hostname` |
|---|
| | 450 | if which dnsdomainname 2>&1 >/dev/null; then |
|---|
| | 451 | VLC_COMPILE_DOMAIN=`dnsdomainname` |
|---|
| | 452 | elif which domainname 2>&1 >/dev/null; then |
|---|
| | 453 | VLC_COMPILE_DOMAIN=`domainname` |
|---|
| | 454 | else |
|---|
| | 455 | VLC_COMPILE_DOMAIN=unknown |
|---|
| | 456 | fi |
|---|
| | 457 | VLC_COMPILER=`$CC -v 2>&1 | tail -n 1` |
|---|
| | 458 | if which svnversion 2>&1 >/dev/null; then |
|---|
| | 459 | VLC_CHANGESET=`svnversion $srcdir` |
|---|
| | 460 | else |
|---|
| | 461 | VLC_CHANGESET='' |
|---|
| | 462 | fi |
|---|
| | 463 | |
|---|
| | 464 | cat >| src/misc/version.c << EOF |
|---|
| | 465 | const char psz_vlc_compile_time[] = "${VLC_COMPILE_TIME}"; |
|---|
| | 466 | const char psz_vlc_compile_by[] = "${VLC_COMPILE_BY}"; |
|---|
| | 467 | const char psz_vlc_compile_host[] = "${VLC_COMPILE_HOST}"; |
|---|
| | 468 | const char psz_vlc_compile_domain[] = "${VLC_COMPILE_DOMAIN}"; |
|---|
| | 469 | const char psz_vlc_compiler[] = "${VLC_COMPILER}"; |
|---|
| | 470 | const char psz_vlc_changeset[] = "${VLC_CHANGESET}"; |
|---|
| | 471 | EOF |
|---|
| | 472 | fi |
|---|
| | 473 | |
|---|
| | 474 | ## |
|---|
| 429 | 475 | ## Fix glade-generated files |
|---|
| 430 | 476 | ## |
|---|