]> git.sesse.net Git - vlc/commitdiff
Fix SVN revision handling.
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 20 May 2007 08:38:20 +0000 (08:38 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 20 May 2007 08:38:20 +0000 (08:38 +0000)
It is by design flawed to have phony built source.

src/Makefile.am
src/libvlc-common.c
src/libvlc.c
src/libvlc.h

index a5110e75ccf00e2b353a8f4db4deb05000fbaf4b..ba8fb9655e0ee0da1d2fbc49b7b42233c6fe0356 100644 (file)
@@ -1,4 +1,4 @@
-
+###############################################################################
 # Automake targets and declarations
 ###############################################################################
 
@@ -10,7 +10,7 @@ SUBDIRS =
 EXTRA_DIST = extras/COPYING modules/builtin.h.in libvlc.sym
 
 BUILT_SOURCES = $(CLEANFILES)
-CLEANFILES = modules/builtin.h
+CLEANFILES = modules/builtin.h misc/revision.c
 MOSTLYCLEANFILES = $(DATA_noinst_libvlc)
 
 TOOLBOX = srcdir=$(top_srcdir) builddir=$(top_builddir) $(top_srcdir)/toolbox
@@ -102,11 +102,13 @@ modules/modules.c: modules/builtin.h
 ###############################################################################
 
 libvlc_a_SOURCES = $(SOURCES_libvlc) $(SOURCES_libvlc_control)
+nodist_libvlc_a_SOURCES = misc/revision.c
 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags libvlc pic` -DUSE_BUILTINS
 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc pic`
 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc pic`
 
 libvlc_la_SOURCES = $(SOURCES_libvlc)
+nodist_libvlc_la_SOURCES = misc/revision.c
 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
@@ -148,12 +150,6 @@ else
 lib_LIBRARIES = libvlc.a
 endif
 
-if HAVE_WIN32
-pic =
-else
-pic = pic
-endif
-
 if HAVE_WIN32
 DATA_noinst_libvlc = libvlc$(LIBEXT) libvlc$(LIBEXT).a
 
@@ -334,11 +330,6 @@ SOURCES_libvlc_control = \
 
 if !USE_LIBTOOL
 if !HAVE_WIN32
-nodist_libvlc_a_SOURCES = misc/version.c
-CLEANFILES += misc/version.c
-
-misc/version.c: FORCE
-       $(TOOLBOX) --update-version
 endif
 
 # Install shared libvlc
@@ -365,6 +356,13 @@ CLEANFILES += stamp-api
 endif
 endif
 
+misc/revision.c:
+       rm -f $@ $@.tmp
+       echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > $@.tmp
+       REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)" ; \
+       echo "const char psz_vlc_changeset[] = \"$$REVISION\";" >> $@.tmp
+       mv -f $@.tmp $@
+
 ###############################################################################
 # Unit/regression test
 ###############################################################################
@@ -387,3 +385,7 @@ test_utf8_LDADD = libvlc.la
 test_utf8_CFLAGS = $(CFLAGS_tests)
 
 FORCE:
+       @echo "Generated source cannot be phony. Go away." >&2
+       @exit 1
+
+.PHONY: FORCE
index 51fc7392877cd6e3eac995497c1fe9e137de1533..6230500ce18080427283c5171eb59587069aab1b 100644 (file)
@@ -1830,11 +1830,9 @@ static void Version( void )
     utf8_fprintf( stdout, _("Compiled by %s@%s.%s\n"),
              VLC_CompileBy(), VLC_CompileHost(), VLC_CompileDomain() );
     utf8_fprintf( stdout, _("Compiler: %s\n"), VLC_Compiler() );
-#ifndef HAVE_SHARED_LIBVLC
     if( strcmp( VLC_Changeset(), "exported" ) )
         utf8_fprintf( stdout, _("Based upon svn changeset [%s]\n"),
                  VLC_Changeset() );
-#endif
     utf8_fprintf( stdout, LICENSE_MSG );
 
 #ifdef WIN32        /* Pause the console because it's destroyed when we exit */
index 1e45824ab011d714033edb2b20e13bceb76cff8b..b515bf1fc1b1ec399e2a36be2680a26e3f5962c4 100644 (file)
@@ -69,13 +69,11 @@ DECLARE_VLC_VERSION( CompileHost, COMPILE_HOST );
 DECLARE_VLC_VERSION( CompileDomain, COMPILE_DOMAIN );
 DECLARE_VLC_VERSION( Compiler, COMPILER );
 
-#ifndef HAVE_SHARED_LIBVLC
 extern const char psz_vlc_changeset[];
-char const * VLC_Changeset( void )
+const char* VLC_Changeset( void )
 {
     return psz_vlc_changeset;
 }
-#endif
 
 /*****************************************************************************
  * VLC_Error: strerror() equivalent
index ee4434eb08db54107694d338d0f189fc2068213c..9fe15565c98d756f524413624f536e94f240d3b6 100644 (file)
@@ -34,7 +34,7 @@ extern vlc_object_t *
 vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type,
                    const char *psz_type);
 
-#if 0
+#if 1
 /*****************************************************************************
  * libvlc_global_data_t (global variable)
  *****************************************************************************