## toolbox for the VLC media player
## $Id$
##
+## Copyright (C) 2005 the VideoLAN team
+##
## Authors: Samuel Hocevar <sam@zoy.org>
+## RĂ©mi Denis-Courmont <rem # videolan.org>
###
### Get a sane environment, just in case
--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
;;
if test "${action}" = "po"
then
# find out the source files
- rm -f po/POTFILES.in
- echo "# automatically created by toolbox --update-po" > po/POTFILES.in
- echo "" >> po/POTFILES.in
- echo "# main sources" >> po/POTFILES.in
- find include src -name '*.[chm]' -o -name '*.[ch]pp' \
- | grep -v '\(vlc_symbols\|misc/modules_\)' \
- | sort >> po/POTFILES.in
- echo "" >> po/POTFILES.in
- echo "# modules" >> po/POTFILES.in
- find modules -name '*.[chm]' -o -name '*.[ch]pp' \
- | grep -v '\(\.moc\.\|gui/gtk2/\)' \
- | sort >> po/POTFILES.in
- # clean old potfiles
- cd po
- rm -f vlc.pot
- # update
- make vlc.pot || exit 1
- make update-po || exit 1
- cd ..
-
- exit 0
+ echo "WARNING: you should run \"make update-po\" instead!" >&2
+ make update-po
+ exit $?
fi
##
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
##
# a naive sanity check to make sure we are in a VLC tree
test -f vlc.spec.mdk -a -f debian/rules || exit 1
# let's rock!
- find . -type f '(' -name '*.[oa]' -o -name '*.so' -o -name '*.sl' -o -name '*.dylib' -o -name '*.dll' -o -name .dirstamp -o -name Makefile.in -o -name 'stamp-h*' -o -name '*~' -o -name '*.bak' -o -name '*.moc.cpp' ')' -exec rm -f '{}' ';'
+ find . -type f '(' -name '*.[oa]' -o -name '*.so' -o -name '*.sl' -o -name '*.dylib' -o -name '*.dll' -o -name .dirstamp -o '(' '(' ! -path '\./doc/developer/Makefile\.in' ')' -a -name Makefile.in ')' -o -name 'stamp-h*' -o -name '*~' -o -name '*.bak' -o -name '*.moc.cpp' ')' -exec rm -f '{}' ';'
(cd autotools && find . -name '[a-z]*' -maxdepth 1 -exec rm -f '{}' ';')
- (cd debian && find . -type d -name '[a-z]*' -maxdepth 1 -exec rm -Rf '{}' ';')
+ (cd debian && find . -type d '(' -name '[a-z]*' ! -name 'patches' ')' -maxdepth 1 -exec rm -Rf '{}' ';')
find msvc -type f -name '*.dsp' -exec rm -f '{}' ';'
find evc -type f -name '*.vcp' -exec rm -f '{}' ';'
- #find . -type d -name '.deps' -exec rm -Rf '{}' ';'
+ find . -type d -name '.deps' -exec rm -Rf '{}' ';'
# there's some more cruft all around
rm -f config.h config.log config.status
rm -f vlc vlc-config Makefile Modules.am