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
if test "${SDL_CONFIG}" != "no"
then
# 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])
fi
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
AC_CHECK_HEADERS(${SDL_IMAGE}, [AC_DEFINE_UNQUOTED(SDL_IMAGE_INCLUDE_FILE,
<${SDL_IMAGE}>, Indicate the path of SDL_image.h)
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])],
[ 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),
......@@ -2986,6 +2992,7 @@ You should install it alongside your SDL package.])
Please install it and try again. Alternatively you can also configure with
--disable-sdl.])
fi
elif test "${enable_sdl}" = "yes"
then
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
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
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 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_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"
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${module_symbol}", [String 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 ) );
* 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 ) );
......
......@@ -370,7 +370,6 @@ char const * vlc_error (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);
void __config_PutPsz (vlc_object_t *, const char *, const char *);
const char * VLC_CompileTime (void);
vlm_schedule_t * vlm_ScheduleNew (vlm_t *, char *);
void net_Close (int fd);
int __vlc_threads_init (vlc_object_t *);
......@@ -831,7 +830,7 @@ struct module_symbols_t
const char * (*VLC_CompileDomain_inner) (void);
const char * (*VLC_CompileHost_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 *);
struct dirent * (*vlc_readdir_wrapper_inner) (void *);
int (*vlc_closedir_wrapper_inner) (void *);
......@@ -1233,7 +1232,6 @@ struct module_symbols_t
# 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
# define playlist_PreparseEnqueueItem (p_symbols)->playlist_PreparseEnqueueItem_inner
# define vlc_readdir_wrapper (p_symbols)->vlc_readdir_wrapper_inner
# define vlc_closedir_wrapper (p_symbols)->vlc_closedir_wrapper_inner
......@@ -1638,7 +1636,6 @@ struct module_symbols_t
((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)->playlist_PreparseEnqueueItem_inner) = playlist_PreparseEnqueueItem; \
((p_symbols)->vlc_readdir_wrapper_inner) = vlc_readdir_wrapper; \
((p_symbols)->vlc_closedir_wrapper_inner) = vlc_closedir_wrapper; \
......@@ -1647,6 +1644,7 @@ struct module_symbols_t
(p_symbols)->vlc_fix_readdir_charset_deprecated = NULL; \
(p_symbols)->__osd_VolumeDown_deprecated = NULL; \
(p_symbols)->__osd_VolumeUp_deprecated = NULL; \
(p_symbols)->VLC_CompileTime_deprecated = NULL; \
# endif /* __PLUGIN__ */
# endif /* HAVE_SHARED_LIBVLC */
......
......@@ -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, "version", VLC_Version() );
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_host",
VLC_CompileHost() );
......
......@@ -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
*****************************************************************************/
#define DECLARE_VLC_VERSION( func, var ) \
extern const char psz_vlc_##var []; \
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( CompileHost, compile_host );
DECLARE_VLC_VERSION( CompileDomain, compile_domain );
DECLARE_VLC_VERSION( Compiler, compiler );
DECLARE_VLC_VERSION( Changeset, changeset );
DECLARE_VLC_VERSION( CompileBy, COMPILE_BY );
DECLARE_VLC_VERSION( CompileHost, COMPILE_HOST );
DECLARE_VLC_VERSION( CompileDomain, COMPILE_HOST );
DECLARE_VLC_VERSION( Compiler, COMPILER );
extern const char psz_vlc_changeset[];
char const * VLC_Changeset( void )
{
return psz_vlc_changeset;
}
/*****************************************************************************
* VLC_Error: strerror() equivalent
......@@ -2392,10 +2395,10 @@ static void Version( void )
#endif
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() );
fprintf( stdout, _("Compiler: %s\n"), VLC_Compiler() );
if( *VLC_Changeset() )
if( strcmp( VLC_Changeset(), "exported" ) )
fprintf( stdout, _("Based upon svn changeset [%s]\n"),
VLC_Changeset() );
fprintf( stdout,
......
......@@ -444,31 +444,31 @@ 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`
VLC_COMPILE_DOMAIN=`dnsdomainname 2>/dev/null || domainname 2>/dev/null || echo unknown`
VLC_COMPILER=`$CC -v 2>&1 | tail -n 1`
file="${builddir}/src/misc/version.c"
if which svnversion 2>&1 >/dev/null; then
VLC_CHANGESET=`svnversion $srcdir`
else
VLC_CHANGESET='exported'
fi
cat >| src/misc/version.c << EOF
cat >| ${file}.tmp << EOF
/* DO NOT EDIT THIS FILE - IT IS REGENERATED AT EVERY COMPILE -
* IT GIVES BETTER TRACKING OFF VLC STABLE AND DEVELOPMENT VERSIONS
* WETHER THEY ARE BUILD BY OTHERS OR DURING DEVELOPMENT OR FOR THE
* IT GIVES BETTER TRACKING OF VLC STABLE AND DEVELOPMENT VERSIONS
* WHETHER THEY ARE BUILT BY OTHERS OR DURING DEVELOPMENT OR FOR THE
* 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}";
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
##
......
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