#! /bin/sh
## toolbox for the VLC media player
-## $Id: toolbox,v 1.16 2003/03/18 01:26:13 sam Exp $
+## $Id: toolbox,v 1.26 2003/06/21 17:04:20 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
--update-includes [BUILTINS] generate various include files
--update-glade generate and fix Glade code
--update-glade2 generate and fix Glade 2 code
+ --update-flexml generate and fix flexml and flex code
+ --distclean "make distclean"
EOF
exit 1
}
{
awk 'BEGIN{a=0}{if(!a&&/^'"$1"'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' < Makefile.am | \
tr '\\ ' '\n\n' | \
- sed -ne 's/[^$-_a-zA-Z0-9][^$-_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p'
+ sed -ne 's/[^-$()_a-zA-Z0-9][^-$()_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p'
}
###
--update-includes)
action=includes
;;
+ --update-flexml)
+ action=flexml
+ ;;
--update-glade|--fix-glade)
action=glade
;;
--update-glade2|--update-glade-2|--fix-glade2)
action=glade2
;;
+ --distclean)
+ action=distclean
+ ;;
--help)
help
;;
then
cvs2cl --help >/dev/null 2>&1 || exit 1
rm -f ChangeLog
- cvs2cl --hide-filenames --no-wrap -w --stdout | \
+ cvs2cl --utc --hide-filenames --no-wrap -w --stdout | \
sed -e 's/^[^0-9]/ /' -e 's/^ *$//' | \
uniq > ChangeLog
exit 0
# The evil ^M
M='\r'
- # Variables we get from configure.ac.in
- LIBVLC_VERSION=`sed -ne '/AC_INIT/s/.*,\(.*\))/\1/p' < configure.ac.in`
- LIBVLC_CODENAME=`sed -ne '/CODENAME=/s/.*"\(.*\)"/\1/p' < configure.ac.in`
+ # Variables we get from configure.ac
+ LIBVLC_VERSION=`sed -ne '/AC_INIT/s/.*,\(.*\))/\1/p' < configure.ac`
+ LIBVLC_CODENAME=`sed -ne '/CODENAME=/s/.*"\(.*\)"/\1/p' < configure.ac`
LIBVLC_SYMBOL=`echo $LIBVLC_VERSION | sed -e 'y/.-/__/'`
# Sources that get built under Win32 - FIXME: anyone wanna deuglify this? :)
then
# create a fake file containing win32 strings
rm -f modules/gui/win32/strings.cpp
- printf "/* Automatically generated by 'toolbox --update-po', please don't compile */\n" > modules/gui/win32/strings.cpp
- find modules/gui/win32 -name '*.dfm' | while read file
- do
- printf "\n/*\n * from $file:\n */\n\n" >> modules/gui/win32/strings.cpp
- perl -ne 'chop; chop; if( / (Caption|Text|Hint) / || $buffer =~ /[+=] *$/ ) { $buffer =~ s/\+ *$//; $buffer .= $_; } if( $buffer =~ /'"'"' *$/) { $buffer =~ s/'"'"'/"/g; $buffer =~ s/\\/\\\\/g; $buffer =~ s/=/= _(/; print $buffer." );\n"; $buffer = "";}' < $file | grep -v '"-*"' | grep -v '"http://' | grep -v '"vlcs"' >> modules/gui/win32/strings.cpp || exit 1
- done
+ #printf "/* Automatically generated by 'toolbox --update-po', please don't compile */\n" > modules/gui/win32/strings.cpp
+ #find modules/gui/win32 -name '*.dfm' | while read file
+ #do
+ # printf "\n/*\n * from $file:\n */\n\n" >> modules/gui/win32/strings.cpp
+ # perl -ne 'chop; chop; if( / (Caption|Text|Hint) / || $buffer =~ /[+=] *$/ ) { $buffer =~ s/\+ *$//; $buffer .= $_; } if( $buffer =~ /'"'"' *$/) { $buffer =~ s/'"'"'/"/g; $buffer =~ s/\\/\\\\/g; $buffer =~ s/=/= _(/; print $buffer." );\n"; $buffer = "";}' < $file | grep -v '"-*"' | grep -v '"http://' | grep -v '"vlcs"' >> modules/gui/win32/strings.cpp || exit 1
+ #done
+ # 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 '*.[hc]pp' | sort >> po/POTFILES.in
+ echo "" >> po/POTFILES.in
+ echo "# modules" >> po/POTFILES.in
+ find modules -name '*.[chm]' -o -name '*.[hc]pp' | grep -v 'gui/win32/' | sort >> po/POTFILES.in
# clean old potfiles
cd po
rm -f vlc.pot
echo '#ifdef __PLUGIN__' >> ${file}.in
cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' >> ${file}.in
echo '#endif /* __PLUGIN__ */' >> ${file}.in
- if ! diff -q ${file} ${file}.in
+ if diff 2>&1 >/dev/null ${file} ${file}.in
then
- mv -f ${file}.in ${file}
- else
rm -f ${file}.in
+ else
+ mv -f ${file}.in ${file}
fi
file=src/misc/modules_plugin.h
echo '#define STORE_SYMBOLS( p_symbols ) \' >> ${file}.tmp
cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> ${file}.tmp
echo '' >> ${file}.tmp
- if ! diff -q ${file} ${file}.tmp
+ if diff 2>&1 >/dev/null ${file} ${file}.tmp
then
- mv -f ${file}.tmp ${file}
- else
rm -f ${file}.tmp
+ else
+ mv -f ${file}.tmp ${file}
fi
file=src/misc/modules_builtin.h
fi
echo " } while( 0 );" >> ${file}.tmp
echo "" >> ${file}.tmp
- if ! diff -q ${file} ${file}.tmp
+ if diff 2>&1 >/dev/null ${file} ${file}.tmp
then
- mv -f ${file}.tmp ${file}
- else
rm -f ${file}.tmp
+ else
+ mv -f ${file}.tmp ${file}
fi
exit 0
exit 0
fi
+##
+## Fix flexml-generated files
+##
+if test "${action}" = "flexml"
+then
+ cd modules/gui/skins/parser
+ flexml -SH -a skin.act skin.dtd
+ # comment the dummy main function
+ file=skin.c
+ sed 's@int main@//int main@' < $file > $file.$$.bak
+ mv -f $file.$$.bak $file
+ flex -oflex.c -BLs skin.l
+fi
+
+##
+## Make distclean
+##
+if test "${action}" = "distclean"
+then
+ set -x
+ # a naive sanity check to make sure we are in a VLC tree
+ test -f vlc.spec -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 '{}' ';'
+ (cd autotools && find . -name '[a-z]*' -exec rm -f '{}' ';')
+ (cd debian && find . -type d -name '[a-z]*' -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 '{}' ';'
+ # there's some more cruft all around
+ rm -f config.h config.log config.status
+ rm -f vlc vlc-config Makefile Modules.am
+ rm -Rf autom4te.cache
+ rm -f mozilla/vlcintf.h mozilla/vlcintf.xpt
+ # FIXME: a lot of Makefiles are still there
+fi
+