--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
;;
fi
# The evil ^M. printf '\r' does not work in Cygwin.
- M='
-'
+ M='\r'
# Variables we get from configure.ac
LIBVLC_VERSION=`sed -ne '/AC_INIT/s/.*,\(.*\))/\1/p' < configure.ac`
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
+
+ file="${builddir}/src/misc/version.c"
+ if which svnversion 2>&1 >/dev/null; then
+ VLC_CHANGESET=`svnversion $srcdir`
+ else
+ VLC_CHANGESET='exported'
+ fi
+
+ rm -f ${file}.tmp
+ cat > ${file}.tmp << EOF
+/* DO NOT EDIT THIS FILE - IT IS REGENERATED AT EVERY COMPILE -
+ * 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_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
+
##
## Fix glade-generated files
##