Commit 74764fb4 authored by Christophe Massiot's avatar Christophe Massiot

* toolbox: Removed compilation information from version.c to reduce the

   compilation time.
 * configure.ac: Compilation information are now determined at
   configure-time. Fixed libSDL_image static linking.
 * src/libvlc.c: Removed VLC_CompileTime() since this is not possible
   without increasing the compilation time.
parent f60342e3
...@@ -2956,7 +2956,7 @@ then ...@@ -2956,7 +2956,7 @@ then
if test "${SDL_CONFIG}" != "no" if test "${SDL_CONFIG}" != "no"
then then
# SDL on Darwin is heavily patched and can only run SDL_image # SDL on Darwin is heavily patched and can only run SDL_image
if test "${SYS}" != "darwin"; then if test "${SYS}" != "darwin" -a "${SYS}" != "mingw32"; then
VLC_ADD_PLUGINS([vout_sdl aout_sdl]) VLC_ADD_PLUGINS([vout_sdl aout_sdl])
fi fi
VLC_ADD_CFLAGS([vout_sdl aout_sdl sdl_image],[`${SDL_CONFIG} ${SDL_PREFIX} --cflags | sed 's,SDL,,'`]) VLC_ADD_CFLAGS([vout_sdl aout_sdl sdl_image],[`${SDL_CONFIG} ${SDL_PREFIX} --cflags | sed 's,SDL,,'`])
...@@ -2973,6 +2973,12 @@ Please install it and try again. Alternatively you can also configure with ...@@ -2973,6 +2973,12 @@ Please install it and try again. Alternatively you can also configure with
AC_CHECK_HEADERS(${SDL_IMAGE}, [AC_DEFINE_UNQUOTED(SDL_IMAGE_INCLUDE_FILE, AC_CHECK_HEADERS(${SDL_IMAGE}, [AC_DEFINE_UNQUOTED(SDL_IMAGE_INCLUDE_FILE,
<${SDL_IMAGE}>, Indicate the path of SDL_image.h) <${SDL_IMAGE}>, Indicate the path of SDL_image.h)
VLC_ADD_PLUGINS([sdl_image]) VLC_ADD_PLUGINS([sdl_image])
AC_CHECK_LIB(png, png_set_rows,
[VLC_ADD_LDFLAGS([sdl_image],[-lpng -lz])],[],[-lz])
AC_CHECK_LIB(jpeg, jpeg_start_decompress,
[VLC_ADD_LDFLAGS([sdl_image],[-ljpeg])])
AC_CHECK_LIB(tiff, TIFFClientOpen,
[VLC_ADD_LDFLAGS([sdl_image],[-ltiff])])
VLC_ADD_LDFLAGS([sdl_image], [-lSDL_image])], VLC_ADD_LDFLAGS([sdl_image], [-lSDL_image])],
[ AC_CHECK_HEADERS(SDL_image.h, AC_DEFINE(SDL_IMAGE_INCLUDE_FILE, <SDL_image.h>, [ AC_CHECK_HEADERS(SDL_image.h, AC_DEFINE(SDL_IMAGE_INCLUDE_FILE, <SDL_image.h>,
As a last resort we also test for SDL_image.h presence), As a last resort we also test for SDL_image.h presence),
...@@ -2986,6 +2992,7 @@ You should install it alongside your SDL package.]) ...@@ -2986,6 +2992,7 @@ You should install it alongside your SDL package.])
Please install it and try again. Alternatively you can also configure with Please install it and try again. Alternatively you can also configure with
--disable-sdl.]) --disable-sdl.])
fi fi
elif test "${enable_sdl}" = "yes" elif test "${enable_sdl}" = "yes"
then then
AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
...@@ -4472,13 +4479,17 @@ AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,"${VERSION_EXTRA}", [version minor numb ...@@ -4472,13 +4479,17 @@ AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,"${VERSION_EXTRA}", [version minor numb
AC_SUBST(VERSION_MAJOR) AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR) AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_REVISION) AC_SUBST(VERSION_REVISION)
AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami`", [user who ran configure])
AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname`", [host which ran configure])
AC_DEFINE_UNQUOTED(VLC_COMPILE_DOMAIN, "`dnsdomainname 2>/dev/null || domainname 2>/dev/null || echo unknown`", [domain of the host which ran configure])
AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1`", [compiler])
dnl Old definitions for version-dependant plugins dnl Old definitions for version-dependant plugins
dnl VLC_SYMBOL="`echo ${VERSION} | sed -e 'y/.-+/___/'`" dnl VLC_SYMBOL="`echo ${VERSION} | sed -e 'y/.-+/___/'`"
dnl AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions]) dnl AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
dnl AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions]) dnl AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
dnl New definitions with value matching 0.8.2 release dnl New definitions with value matching 0.8.4 release
module_symbol="0_8_4" module_symbol="0_8_4"
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${module_symbol}", [String suffix for module functions]) AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${module_symbol}", [String suffix for module functions])
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $module_symbol, [Symbol suffix for module functions]) AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $module_symbol, [Symbol suffix for module functions])
......
...@@ -1094,7 +1094,6 @@ VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) ); ...@@ -1094,7 +1094,6 @@ VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) );
* libvlc features * libvlc features
*****************************************************************************/ *****************************************************************************/
VLC_EXPORT( const char *, VLC_Version, ( void ) ); 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_CompileBy, ( void ) );
VLC_EXPORT( const char *, VLC_CompileHost, ( void ) ); VLC_EXPORT( const char *, VLC_CompileHost, ( void ) );
VLC_EXPORT( const char *, VLC_CompileDomain, ( void ) ); VLC_EXPORT( const char *, VLC_CompileDomain, ( void ) );
......
...@@ -370,7 +370,6 @@ char const * vlc_error (int); ...@@ -370,7 +370,6 @@ char const * vlc_error (int);
int playlist_NodeGroup (playlist_t *, int,playlist_item_t *,playlist_item_t **,int, int, int); int playlist_NodeGroup (playlist_t *, int,playlist_item_t *,playlist_item_t **,int, int, int);
playlist_item_t* playlist_ItemNewWithType (vlc_object_t *,const char *,const char *, int); playlist_item_t* playlist_ItemNewWithType (vlc_object_t *,const char *,const char *, int);
void __config_PutPsz (vlc_object_t *, const char *, const char *); void __config_PutPsz (vlc_object_t *, const char *, const char *);
const char * VLC_CompileTime (void);
vlm_schedule_t * vlm_ScheduleNew (vlm_t *, char *); vlm_schedule_t * vlm_ScheduleNew (vlm_t *, char *);
void net_Close (int fd); void net_Close (int fd);
int __vlc_threads_init (vlc_object_t *); int __vlc_threads_init (vlc_object_t *);
...@@ -831,7 +830,7 @@ struct module_symbols_t ...@@ -831,7 +830,7 @@ struct module_symbols_t
const char * (*VLC_CompileDomain_inner) (void); const char * (*VLC_CompileDomain_inner) (void);
const char * (*VLC_CompileHost_inner) (void); const char * (*VLC_CompileHost_inner) (void);
const char * (*VLC_Version_inner) (void); const char * (*VLC_Version_inner) (void);
const char * (*VLC_CompileTime_inner) (void); void *VLC_CompileTime_deprecated;
int (*playlist_PreparseEnqueueItem_inner) (playlist_t *, playlist_item_t *); int (*playlist_PreparseEnqueueItem_inner) (playlist_t *, playlist_item_t *);
struct dirent * (*vlc_readdir_wrapper_inner) (void *); struct dirent * (*vlc_readdir_wrapper_inner) (void *);
int (*vlc_closedir_wrapper_inner) (void *); int (*vlc_closedir_wrapper_inner) (void *);
...@@ -1233,7 +1232,6 @@ struct module_symbols_t ...@@ -1233,7 +1232,6 @@ struct module_symbols_t
# define VLC_CompileDomain (p_symbols)->VLC_CompileDomain_inner # define VLC_CompileDomain (p_symbols)->VLC_CompileDomain_inner
# define VLC_CompileHost (p_symbols)->VLC_CompileHost_inner # define VLC_CompileHost (p_symbols)->VLC_CompileHost_inner
# define VLC_Version (p_symbols)->VLC_Version_inner # define VLC_Version (p_symbols)->VLC_Version_inner
# define VLC_CompileTime (p_symbols)->VLC_CompileTime_inner
# define playlist_PreparseEnqueueItem (p_symbols)->playlist_PreparseEnqueueItem_inner # define playlist_PreparseEnqueueItem (p_symbols)->playlist_PreparseEnqueueItem_inner
# define vlc_readdir_wrapper (p_symbols)->vlc_readdir_wrapper_inner # define vlc_readdir_wrapper (p_symbols)->vlc_readdir_wrapper_inner
# define vlc_closedir_wrapper (p_symbols)->vlc_closedir_wrapper_inner # define vlc_closedir_wrapper (p_symbols)->vlc_closedir_wrapper_inner
...@@ -1638,7 +1636,6 @@ struct module_symbols_t ...@@ -1638,7 +1636,6 @@ struct module_symbols_t
((p_symbols)->VLC_CompileDomain_inner) = VLC_CompileDomain; \ ((p_symbols)->VLC_CompileDomain_inner) = VLC_CompileDomain; \
((p_symbols)->VLC_CompileHost_inner) = VLC_CompileHost; \ ((p_symbols)->VLC_CompileHost_inner) = VLC_CompileHost; \
((p_symbols)->VLC_Version_inner) = VLC_Version; \ ((p_symbols)->VLC_Version_inner) = VLC_Version; \
((p_symbols)->VLC_CompileTime_inner) = VLC_CompileTime; \
((p_symbols)->playlist_PreparseEnqueueItem_inner) = playlist_PreparseEnqueueItem; \ ((p_symbols)->playlist_PreparseEnqueueItem_inner) = playlist_PreparseEnqueueItem; \
((p_symbols)->vlc_readdir_wrapper_inner) = vlc_readdir_wrapper; \ ((p_symbols)->vlc_readdir_wrapper_inner) = vlc_readdir_wrapper; \
((p_symbols)->vlc_closedir_wrapper_inner) = vlc_closedir_wrapper; \ ((p_symbols)->vlc_closedir_wrapper_inner) = vlc_closedir_wrapper; \
...@@ -1647,6 +1644,7 @@ struct module_symbols_t ...@@ -1647,6 +1644,7 @@ struct module_symbols_t
(p_symbols)->vlc_fix_readdir_charset_deprecated = NULL; \ (p_symbols)->vlc_fix_readdir_charset_deprecated = NULL; \
(p_symbols)->__osd_VolumeDown_deprecated = NULL; \ (p_symbols)->__osd_VolumeDown_deprecated = NULL; \
(p_symbols)->__osd_VolumeUp_deprecated = NULL; \ (p_symbols)->__osd_VolumeUp_deprecated = NULL; \
(p_symbols)->VLC_CompileTime_deprecated = NULL; \
# endif /* __PLUGIN__ */ # endif /* __PLUGIN__ */
# endif /* HAVE_SHARED_LIBVLC */ # endif /* HAVE_SHARED_LIBVLC */
......
...@@ -479,8 +479,6 @@ int E_(HttpCallback)( httpd_file_sys_t *p_args, ...@@ -479,8 +479,6 @@ int E_(HttpCallback)( httpd_file_sys_t *p_args,
E_(mvar_AppendNewVar)( p_args->vars, "url_value", p_request ); E_(mvar_AppendNewVar)( p_args->vars, "url_value", p_request );
E_(mvar_AppendNewVar)( p_args->vars, "version", VLC_Version() ); E_(mvar_AppendNewVar)( p_args->vars, "version", VLC_Version() );
E_(mvar_AppendNewVar)( p_args->vars, "copyright", COPYRIGHT_MESSAGE ); E_(mvar_AppendNewVar)( p_args->vars, "copyright", COPYRIGHT_MESSAGE );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_time",
VLC_CompileTime() );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_by", VLC_CompileBy() ); E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_by", VLC_CompileBy() );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_host", E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_host",
VLC_CompileHost() ); VLC_CompileHost() );
......
...@@ -139,22 +139,25 @@ char const * VLC_Version( void ) ...@@ -139,22 +139,25 @@ char const * VLC_Version( void )
} }
/***************************************************************************** /*****************************************************************************
* VLC_CompileTime, VLC_CompileBy, VLC_CompileHost, VLC_CompileDomain, * VLC_CompileBy, VLC_CompileHost, VLC_CompileDomain,
* VLC_Compiler, VLC_Changeset * VLC_Compiler, VLC_Changeset
*****************************************************************************/ *****************************************************************************/
#define DECLARE_VLC_VERSION( func, var ) \ #define DECLARE_VLC_VERSION( func, var ) \
extern const char psz_vlc_##var []; \
char const * VLC_##func ( void ) \ char const * VLC_##func ( void ) \
{ \ { \
return psz_vlc_##var ; \ return VLC_##var ; \
} }
DECLARE_VLC_VERSION( CompileTime, compile_time ); DECLARE_VLC_VERSION( CompileBy, COMPILE_BY );
DECLARE_VLC_VERSION( CompileBy, compile_by ); DECLARE_VLC_VERSION( CompileHost, COMPILE_HOST );
DECLARE_VLC_VERSION( CompileHost, compile_host ); DECLARE_VLC_VERSION( CompileDomain, COMPILE_HOST );
DECLARE_VLC_VERSION( CompileDomain, compile_domain ); DECLARE_VLC_VERSION( Compiler, COMPILER );
DECLARE_VLC_VERSION( Compiler, compiler );
DECLARE_VLC_VERSION( Changeset, changeset ); extern const char psz_vlc_changeset[];
char const * VLC_Changeset( void )
{
return psz_vlc_changeset;
}
/***************************************************************************** /*****************************************************************************
* VLC_Error: strerror() equivalent * VLC_Error: strerror() equivalent
...@@ -2392,10 +2395,10 @@ static void Version( void ) ...@@ -2392,10 +2395,10 @@ static void Version( void )
#endif #endif
fprintf( stdout, _("VLC version %s\n"), VLC_Version() ); fprintf( stdout, _("VLC version %s\n"), VLC_Version() );
fprintf( stdout, _("Compiled on %s by %s@%s.%s\n"), VLC_CompileTime(), fprintf( stdout, _("Compiled by %s@%s.%s\n"),
VLC_CompileBy(), VLC_CompileHost(), VLC_CompileDomain() ); VLC_CompileBy(), VLC_CompileHost(), VLC_CompileDomain() );
fprintf( stdout, _("Compiler: %s\n"), VLC_Compiler() ); fprintf( stdout, _("Compiler: %s\n"), VLC_Compiler() );
if( *VLC_Changeset() ) if( strcmp( VLC_Changeset(), "exported" ) )
fprintf( stdout, _("Based upon svn changeset [%s]\n"), fprintf( stdout, _("Based upon svn changeset [%s]\n"),
VLC_Changeset() ); VLC_Changeset() );
fprintf( stdout, fprintf( stdout,
......
...@@ -444,31 +444,31 @@ then ...@@ -444,31 +444,31 @@ then
CC="`sed -ne 's/^CC *= *//p' < Makefile`" CC="`sed -ne 's/^CC *= *//p' < Makefile`"
fi fi
VLC_COMPILE_TIME=`LC_ALL=C LANG=C date` file="${builddir}/src/misc/version.c"
VLC_COMPILE_BY=`whoami`
VLC_COMPILE_HOST=`hostname`
VLC_COMPILE_DOMAIN=`dnsdomainname 2>/dev/null || domainname 2>/dev/null || echo unknown`
VLC_COMPILER=`$CC -v 2>&1 | tail -n 1`
if which svnversion 2>&1 >/dev/null; then if which svnversion 2>&1 >/dev/null; then
VLC_CHANGESET=`svnversion $srcdir` VLC_CHANGESET=`svnversion $srcdir`
else else
VLC_CHANGESET='exported' VLC_CHANGESET='exported'
fi fi
cat >| src/misc/version.c << EOF cat >| ${file}.tmp << EOF
/* DO NOT EDIT THIS FILE - IT IS REGENERATED AT EVERY COMPILE - /* DO NOT EDIT THIS FILE - IT IS REGENERATED AT EVERY COMPILE -
* IT GIVES BETTER TRACKING OFF VLC STABLE AND DEVELOPMENT VERSIONS * IT GIVES BETTER TRACKING OF VLC STABLE AND DEVELOPMENT VERSIONS
* WETHER THEY ARE BUILD BY OTHERS OR DURING DEVELOPMENT OR FOR THE * WHETHER THEY ARE BUILT BY OTHERS OR DURING DEVELOPMENT OR FOR THE
* OFFICIAL VLC STABLE RELEASES. * OFFICIAL VLC STABLE RELEASES.
*/ */
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}"; const char psz_vlc_changeset[] = "${VLC_CHANGESET}";
EOF EOF
if diff >/dev/null 2>&1 ${file} ${file}.tmp
then
rm -f ${file}.tmp
else
echo "creating new ${file}"
mv -f ${file}.tmp ${file}
fi
exit 0
fi fi
## ##
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment