#! /bin/sh
## toolbox for vlc, the VideoLAN Client
-## $Id: toolbox,v 1.2 2003/01/13 15:20:24 sam Exp $
+## $Id: toolbox,v 1.5 2003/01/16 12:49:28 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
# 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`
+ LIBVLC_SYMBOL=`echo $LIBVLC_VERSION | sed -e 'y/.-/__/'`
+
# Sources that get built under Win32 - FIXME: anyone wanna deuglify this? :)
LIBVLC_SOURCES=`awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_common'[^-_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'; awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_win32'[^-_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'; awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_dirent'[^-_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'; awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_getopt'[^-_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'; awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_libc'[^-_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'`
# Clean up
rm -f evc/*.vcp msvc/*.dsp
+ # config files
+ for target in evc/config.h msvc/config.h
+ do
+ echo "${target}"
+ rm -f ${target}
+ sed -e "s/@CODENAME@/${LIBVLC_CODENAME}/" \
+ -e "s/@VERSION@/${LIBVLC_VERSION}/" \
+ -e "s/@SYMBOL@/${LIBVLC_SYMBOL}/" < ${target}.in > ${target}
+ done
+
# libvlc files
for target in evc/libvlc.vcp msvc/libvlc.dsp
do
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/* from $file: */\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 >> modules/gui/win32/strings.cpp || exit 1
+ 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 '"-*"' >> modules/gui/win32/strings.cpp || exit 1
done
# clean old potfiles
cd po