3 ## toolbox for the VLC media player
6 ## Copyright (C) 2005 the VideoLAN team
8 ## Authors: Samuel Hocevar <sam@zoy.org>
9 ## Rémi Denis-Courmont <rem # videolan.org>
12 ### Get a sane environment, just in case
28 --update-vc update Microsoft Visual Studio files
29 --update-vc7 update Microsoft Visual .NET files
30 --update-po update translation files
31 --update-includes generate various include files
32 --update-version generate src/misc/version.c
33 --update-glade generate and fix Glade code
34 --update-glade2 generate and fix Glade 2 code
35 --update-flexml generate and fix flexml and flex code
36 --distclean "make distclean" on steroids
37 --dist-contrib add the contrib dir to MAKE_DIST
38 --make-woody <dir> change distdir <dir> to a woody distdir
44 ## Extract stuff from Makefile.am
48 awk 'BEGIN{a=0}{if(!a&&$0~/^'"$1"'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if($0~/^[a-zA-Z]/){exit;}print $0}}' < "${srcdir}/Makefile.am" | \
50 sed -ne 's/[^-$()_a-zA-Z0-9][^-$()_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p' | \
51 sed -e "s,^,${srcdir}/,"
64 --changelog|--update-changelog)
85 --update-glade|--fix-glade)
88 --update-glade2|--update-glade-2|--fix-glade2)
107 echo "$0: unknown option $1"
114 ## Add includes to help doxygen
116 if test "${action}" = "include"
119 */vlc_common.h|*/include/vlc/*);;
120 */include/*.h) echo "#include <vlc_common.h>" ;;
127 ## Update the CVS changelog
129 if test "${action}" = "changelog"
132 echo "toolbox --changelog no longer required. use this instead:"
133 echo " svn log -v -r '{$YEAR-12-31}:{$YEAR-01-01}' > ChangeLog"
138 ## Update the MSVC project files
140 if test "${action}" = "vc"
142 echo "generating Visual Studio files"
144 if test -z "${srcdir}"; then
145 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
148 # The evil ^M. printf '\r' does not work in Cygwin.
151 # Variables we get from configure.ac
152 LIBVLC_VERSION=`sed -ne '/AC_INIT/s/.*,\(.*\))/\1/p' < configure.ac`
153 LIBVLC_CODENAME=`sed -ne '/CODENAME=/s/.*"\(.*\)"/\1/p' < configure.ac`
154 LIBVLC_SYMBOL=`echo $LIBVLC_VERSION | sed -e 'y/.-/__/'`
156 # Sources that get built under Win32 - FIXME: anyone wanna deuglify this? :)
157 LIBVLC_SOURCES=`getfiles SOURCES_libvlc_common; getfiles SOURCES_libvlc_win32; getfiles SOURCES_libvlc_dirent; getfiles SOURCES_libvlc_getopt; getfiles SOURCES_libvlc_libc`
159 LIBVLC_HEADERS=`getfiles HEADERS_include; getfiles HEADERS_include_built`
161 LIBVLC_PKG_HEADERS=`getfiles dist_pkginclude_HEADERS`
164 rm -f evc/*.vcp msvc/*.dsp msvc/*.vcproj msvc/*.sln msvc/*.ncb
167 for target in evc/config.h msvc/config.h
171 sed -e "s/@CODENAME@/${LIBVLC_CODENAME}/" \
172 -e "s/@VERSION@/${LIBVLC_VERSION}/" \
173 -e "s/@SYMBOL@/${LIBVLC_SYMBOL}/" < ${target}.in > ${target}
177 for target in evc/libvlc.vcp msvc/libvlc.dsp
180 # Top of the project file
181 perl -pe 'if(/§SOURCES§/){last;}' < ${target}.in > ${target}
183 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep -v "/.*/"`
185 cat >> ${target} << EOF
186 # Begin Source File${M}
187 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
188 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
189 # End Source File${M}
192 for subdir in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/.*/" | cut -f2 -d/ | sort | uniq`
194 cat >> ${target} << EOF
195 # Begin Group "${subdir}"${M}
197 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/${subdir}/"`
199 subdir="`echo ${file} | sed -e 's%/[^/]*$%/%' | sed -e 's%/%\\\\%g'`"
200 if test "${target}" = "evc/libvlc.vcp"
202 cat >> ${target} << EOF
203 # Begin Source File${M}
204 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
205 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
206 !IF "\$(CFG)" == "libvlc - Win32 (WCE MIPS) Release"${M}
207 # PROP Output_Dir "MIPSRel\\${subdir}"${M}
208 # PROP Intermediate_Dir "MIPSRel\\${subdir}"${M}
209 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE MIPS) Debug"${M}
210 # PROP Output_Dir "MIPSDbg\\${subdir}"${M}
211 # PROP Intermediate_Dir "MIPSDbg\\${subdir}"${M}
212 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH4) Release"${M}
213 # PROP Output_Dir "SH4Rel\\${subdir}"${M}
214 # PROP Intermediate_Dir "SH4Rel\\${subdir}"${M}
215 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH4) Debug"${M}
216 # PROP Output_Dir "SH4Dbg\\${subdir}"${M}
217 # PROP Intermediate_Dir "SH4Dbg\\${subdir}"${M}
218 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH3) Release"${M}
219 # PROP Output_Dir "SH3Rel\\${subdir}"${M}
220 # PROP Intermediate_Dir "SH3Rel\\${subdir}"${M}
221 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH3) Debug"${M}
222 # PROP Output_Dir "SH3Dbg\\${subdir}"${M}
223 # PROP Intermediate_Dir "SH3Dbg\\${subdir}"${M}
224 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARM) Release"${M}
225 # PROP Output_Dir "ARMRel\\${subdir}"${M}
226 # PROP Intermediate_Dir "ARMRel\\${subdir}"${M}
227 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARM) Debug"${M}
228 # PROP Output_Dir "ARMDbg\\${subdir}"${M}
229 # PROP Intermediate_Dir "ARMDbg\\${subdir}"${M}
230 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARMV4) Release"${M}
231 # PROP Output_Dir "ARMV4Rel\\${subdir}"${M}
232 # PROP Intermediate_Dir "ARMV4Rel\\${subdir}"${M}
233 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARMV4) Debug"${M}
234 # PROP Output_Dir "ARMV4Dbg\\${subdir}"${M}
235 # PROP Intermediate_Dir "ARMV4Dbg\\${subdir}"${M}
236 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86em) Release"${M}
237 # PROP Output_Dir "X86EMRel\\${subdir}"${M}
238 # PROP Intermediate_Dir "X86EMRel\\${subdir}"${M}
239 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86em) Debug"${M}
240 # PROP Output_Dir "X86EMDbg\\${subdir}"${M}
241 # PROP Intermediate_Dir "X86EMDbg\\${subdir}"${M}
242 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE emulator) Debug"${M}
243 # PROP Output_Dir "emulatorDbg\\${subdir}"${M}
244 # PROP Intermediate_Dir "emulatorDbg\\${subdir}"${M}
245 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE emulator) Release"${M}
246 # PROP Output_Dir "emulatorRel\\${subdir}"${M}
247 # PROP Intermediate_Dir "emulatorRel\\${subdir}"${M}
248 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86) Debug"${M}
249 # PROP Output_Dir "X86Dbg\\${subdir}"${M}
250 # PROP Intermediate_Dir "X86Dbg\\${subdir}"${M}
251 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86) Release"${M}
252 # PROP Output_Dir "X86Rel\\${subdir}"${M}
253 # PROP Intermediate_Dir "X86Rel\\${subdir}"${M}
255 # End Source File${M}
258 cat >> ${target} << EOF
259 # Begin Source File${M}
260 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
261 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
262 !IF "\$(CFG)" == "libvlc - Win32 Release"${M}
263 # PROP Output_Dir "Release\\${subdir}"${M}
264 # PROP Intermediate_Dir "Release\\${subdir}"${M}
265 !ELSEIF "\$(CFG)" == "libvlc - Win32 Debug"${M}
266 # PROP Output_Dir "Debug\\${subdir}"${M}
267 # PROP Intermediate_Dir "Debug\\${subdir}"${M}
269 # End Source File${M}
273 cat >> ${target} << EOF
278 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${target}.in >> ${target}
279 for file in ${LIBVLC_HEADERS}
281 cat >> ${target} << EOF
282 # Begin Source File${M}
283 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
284 # End Source File${M}
287 cat >> ${target} << EOF
288 # Begin Group "vlc"${M}
290 for file in ${LIBVLC_PKG_HEADERS}
292 cat >> ${target} << EOF
293 # Begin Source File${M}
294 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
295 # End Source File${M}
298 cat >> ${target} << EOF
301 perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
305 for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' ${srcdir}/configure.ac`
307 mf="${srcdir}/modules/${dir}/Modules.am"
308 for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
310 # this is an attempt at getting a list of plugin sources... we take the
311 # production and remove everything that does not contain "module", which
312 # means you miss $(NULL), but other variables too.
313 allfiles=`grep -v '[^-_a-zA-Z0-9]*#' ${mf} | awk 'BEGIN{a=0}{if(!a&&$0~/^SOURCES_'${mod}'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if($0~/^[a-zA-Z]/){exit;}print $0}}' | tr '\\ ' '\n\n' | grep '\.'`
314 hfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep '\.h$'`
315 cfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep -v '\.h$'`
316 for msdir in evc msvc
318 test "${msdir}" = "evc" && suf="vcp" || suf="dsp"
319 source="${msdir}/plugins.${suf}.in"
320 target="${msdir}/plugin_${mod}.${suf}"
322 perl -pe 'if(/§SOURCES§/){last;} s/§PLUGIN§/'${mod}'/g' < ${source} > ${target}
323 for cfile in ${cfiles}
325 cat >> ${target} << EOF
326 # Begin Source File${M}
327 SOURCE="..\\modules\\`echo ${dir}/${cfile} | sed 's,/,\\\\,g'`"${M}
328 # ADD CPP /D "__VLC__" /D "__PLUGIN__" /D "MODULE_NAME=${mod}" /D "MODULE_NAME_IS_${mod}" ${M}
329 !IF "\$(CFG)" == "plugin_${mod} - Win32 Release"${M}
330 # PROP Output_Dir "Release\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
331 # PROP Intermediate_Dir "Release\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
332 !ELSEIF "\$(CFG)" == "plugin_${mod} - Win32 Debug"${M}
333 # PROP Output_Dir "Debug\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
334 # PROP Intermediate_Dir "Debug\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
335 # End Source File${M}
338 # sed is really nicer for this... unfortunately it's broken under cygwin
339 # sed -ne '1,/§SOURCES§/d; /§HEADERS§/,$d; p' < ${source} >> ${target}
340 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${source} >> ${target}
341 for hfile in ${hfiles}
343 cat >> ${target} << EOF
344 # Begin Source File${M}
345 SOURCE="..\\modules\\`echo ${dir}/${hfile} | sed 's,/,\\\\,g'`"${M}
346 # End Source File${M}
349 # sed -ne '1,/§HEADERS§/d; p' < ${source} >> ${target}
350 perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${source} >> ${target}
356 for target in evc/vlc.vcp msvc/vlc.dsp
359 # Top of the project file
360 perl -pe 'if(/§SOURCES§/){last;}' < ${target}.in > ${target}
362 cat >> ${target} << EOF
363 # Begin Source File${M}
364 SOURCE="..\\src\\vlc.c"${M}
365 # End Source File${M}
367 # Bottom of the project file - handles resource files too
368 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
376 ## Update the MSVC (.NET) project files
378 if test "${action}" = "vc7"
380 echo "generating Visual .NET files"
384 # The evil ^M. printf '\r' does not work in Cygwin.
388 # Variables we get from configure.ac
389 LIBVLC_VERSION=`sed -ne '/AC_INIT/s/.*,\(.*\))/\1/p' < configure.ac`
390 LIBVLC_CODENAME=`sed -ne '/CODENAME=/s/.*"\(.*\)"/\1/p' < configure.ac`
391 LIBVLC_SYMBOL=`echo $LIBVLC_VERSION | sed -e 'y/.-/__/'`
393 # Sources that get built under Win32 - FIXME: anyone wanna deuglify this? :)
394 LIBVLC_SOURCES=`getfiles SOURCES_libvlc_common; getfiles SOURCES_libvlc_win32; getfiles SOURCES_libvlc_dirent; getfiles SOURCES_libvlc_getopt; getfiles SOURCES_libvlc_libc`
396 LIBVLC_HEADERS=`getfiles HEADERS_include; getfiles HEADERS_include_built`
398 LIBVLC_PKG_HEADERS=`getfiles dist_pkginclude_HEADERS`
404 for target in msvc/config.h
408 sed -e "s/@CODENAME@/${LIBVLC_CODENAME}/" \
409 -e "s/@VERSION@/${LIBVLC_VERSION}/" \
410 -e "s/@SYMBOL@/${LIBVLC_SYMBOL}/" < ${target}.in > ${target}
414 target="msvc/vlc.vcproj"
416 # Top of the project file
417 guid=`perl -e 'sub r {return sprintf("%X", int rand(65536))} print r.r."-".r."-".r."-".r."-".r.r.r'`
418 perl -pe 'if(/§SOURCES§/){last;} s/§GUID§/'${guid}'/g' < ${target}.in > ${target}
420 cat >> ${target} << EOF
421 <File RelativePath="..\\src\\vlc.c"></File>${M}
423 # Bottom of the project file - handles resource files too
424 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
427 target=msvc/libvlc.vcproj
429 # Top of the project file
430 guid=`perl -e 'sub r {return sprintf("%X", int rand(65536))} print r.r."-".r."-".r."-".r."-".r.r.r'`
431 perl -pe 'if(/§SOURCES§/){last;} s/§GUID§/'${guid}'/g' < ${target}.in > ${target}
433 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep -v "/.*/"`
435 cat >> ${target} << EOF
436 <File RelativePath="..\\`echo ${dir}/${file} | sed 's,/,\\\\,g'`"></File>${M}
439 for subdir in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/.*/" | cut -f2 -d/ | sort | uniq`
441 cat >> ${target} << EOF
442 <Filter Name="`echo ${subdir} | sed s,/,_,g`" Filter="c;cpp">${M}
444 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/${subdir}/"`
446 cat >> ${target} << EOF
447 <File RelativePath="..\\`echo ${file} | sed 's,/,\\\\,g'`">${M}
449 if echo ${file} | grep -q '.c$'
451 cat >> ${target} << EOF
452 <FileConfiguration Name="Debug|Win32">${M}
453 <Tool Name="VCCLCompilerTool" ObjectFile="\$(IntDir)/\$(ProjectName)/`echo ${file} | sed -e s/\.c$/.obj/`"/>${M}
454 </FileConfiguration>${M}
457 cat >> ${target} << EOF
461 cat >> ${target} << EOF
466 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${target}.in >> ${target}
467 for file in ${LIBVLC_HEADERS}
469 cat >> ${target} << EOF
470 <File RelativePath="..\\`echo ${file} | sed 's,/,\\\\,g'`"></File>${M}
473 cat >> ${target} << EOF
474 <Filter Name="vlc" Filter="h;hpp">${M}
476 for file in ${LIBVLC_PKG_HEADERS}
478 cat >> ${target} << EOF
479 <File RelativePath="..\\`echo ${file} | sed 's,/,\\\\,g'`"></File>${M}
482 cat >> ${target} << EOF
485 perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
488 for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' ${srcdir}/configure.ac`
490 mf="${srcdir}/modules/${dir}/Modules.am"
491 for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
493 # this is an attempt at getting a list of plugin sources... we take the
494 # production and remove everything that does not contain "module", which
495 # means you miss $(NULL), but other variables too.
496 allfiles=`grep -v '[^-_a-zA-Z0-9]*#' ${mf} | awk 'BEGIN{a=0}{if(!a&&$0~/^SOURCES_'${mod}'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if($0~/^[a-zA-Z]/){exit;}print $0}}' | tr '\\ ' '\n\n' | grep '\.'`
497 hfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep '\.h$'`
498 cfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep -v '\.h$'`
501 source="${msdir}/plugins.vcproj.in"
502 target="${msdir}/plugin_${mod}.vcproj"
504 guid=`perl -e 'sub r {return sprintf("%X", int rand(65536))} print r.r."-".r."-".r."-".r."-".r.r.r'`
505 perl -pe 'if(/§SOURCES§/){last;} s/§PLUGIN§/'${mod}'/g' < ${source} | sed 's,§GUID§,'${guid}',' > ${target}
506 for cfile in ${cfiles}
508 cat >> ${target} << EOF
509 <File RelativePath="..\\modules\\`echo ${dir}/${cfile} | sed 's,/,\\\\,g'`"></File>${M}
512 # sed is really nicer for this... unfortunately it's broken under cygwin
513 # sed -ne '1,/§SOURCES§/d; /§HEADERS§/,$d; p' < ${source} >> ${target}
514 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${source} >> ${target}
515 for hfile in ${hfiles}
517 cat >> ${target} << EOF
518 <File RelativePath="..\\modules\\`echo ${dir}/${hfile} | sed 's,/,\\\\,g'`"></File>${M}
521 # sed -ne '1,/§HEADERS§/d; p' < ${source} >> ${target}
522 perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${source} >> ${target}
532 ## Update the potfiles because no one ever does it
534 if test "${action}" = "po"
536 # find out the source files
537 echo "WARNING: you should run \"make update-po\" instead!" >&2
543 ## Create include files
545 if test "${action}" = "includes"
549 if test -z "${srcdir}"; then
550 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
552 if test -z "${builddir}"; then
553 builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`"
555 BUILTINS=`sed -ne 's/.*builtins *= *" *\([^"]*\)".*/\1/p' vlc-config`
557 file="${builddir}/src/misc/modules_builtin.h"
559 rm -f ${file}.tmp && cp ${srcdir}/src/misc/modules_builtin.h.in ${file}.tmp
560 if test -n "${BUILTINS}"
562 for i in `echo ${BUILTINS}`
564 echo "int vlc_entry__`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`( module_t* );" >>${file}.tmp
566 echo "" >> ${file}.tmp
568 echo "#define ALLOCATE_ALL_BUILTINS() \\" >> ${file}.tmp
569 echo " do \\" >> ${file}.tmp
570 echo " { \\" >> ${file}.tmp
571 if test -n "${BUILTINS}"
573 for i in `echo ${BUILTINS}`
575 echo " ALLOCATE_BUILTIN(`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`); \\" >> ${file}.tmp
578 echo " } while( 0 );" >> ${file}.tmp
579 echo "" >> ${file}.tmp
580 if diff >/dev/null 2>&1 ${file} ${file}.tmp
584 echo "creating new ${file}"
585 mv -f ${file}.tmp ${file}
592 ## Create version file
594 if test "${action}" = "version"
596 if test -z "${srcdir}"; then
597 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
599 if test -z "${builddir}"; then
600 builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`"
602 if test -z "${CC}"; then
603 CC="`sed -ne 's/^CC *= *//p' < Makefile`"
606 file="${builddir}/src/misc/version.c"
607 if which svnversion 2>&1 >/dev/null; then
608 VLC_CHANGESET=`svnversion $srcdir`
610 VLC_CHANGESET='exported'
614 cat > ${file}.tmp << EOF
615 /* DO NOT EDIT THIS FILE - IT IS REGENERATED AT EVERY COMPILE -
616 * IT GIVES BETTER TRACKING OF VLC STABLE AND DEVELOPMENT VERSIONS
617 * WHETHER THEY ARE BUILT BY OTHERS OR DURING DEVELOPMENT OR FOR THE
618 * OFFICIAL VLC STABLE RELEASES.
620 const char psz_vlc_changeset[] = "${VLC_CHANGESET}";
623 if diff >/dev/null 2>&1 ${file} ${file}.tmp
627 echo "creating new ${file}"
628 mv -f ${file}.tmp ${file}
635 ## Fix glade-generated files
637 if test "${action}" = "glade"
639 for file in modules/gui/gtk/gnome.glade modules/gui/gtk/gtk.glade modules/gui/familiar/familiar.glade
641 echo "generating code from $file"
642 glade -w $file || exit 1
645 for file in modules/gui/gtk/gnome_interface.c modules/gui/gtk/gtk_interface.c modules/gui/familiar/interface.c
648 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
651 cat > $file.$$.bak << EOF
652 /* This file was created automatically by glade and fixed by bootstrap */
657 -e 's#_(\(".:..:.."\))#\1#' \
658 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
659 -e 's#_("---")#"---"#' \
660 -e 's#_("--")#"--"#' \
661 -e 's#_(\("/dev/[^"]*"\))#"\1"#' \
662 -e 's#_(\("./."\))#\1#' \
663 < $file >> $file.$$.bak
664 mv -f $file.$$.bak $file
668 for file in modules/gui/gtk/gtk_support.h modules/gui/familiar/support.h
671 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
674 sed -e 's/DO NOT EDIT.*/Created by glade, fixed by bootstrap/' \
675 -e 's,<config.h>,<vlc/vlc.h>,' \
676 -e 's,#if.*ENABLE_NLS.*,#if 0 /* Disabled by bootstrap */,' \
677 -e 's,#else,/* & */,' \
678 < $file > $file.$$.bak
679 mv -f $file.$$.bak $file
687 ## Fix glade2-generated files
689 if test "${action}" = "glade2"
691 for file in modules/gui/gtk2/gnome2.glade modules/gui/gtk2/gtk2.glade modules/gui/pda/pda.glade
693 echo "generating code from $file"
694 glade-2 -w $file || exit 1
697 for file in modules/gui/pda/pda_interface.c
700 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
703 cat > $file.$$.bak << EOF
704 /* This file was created automatically by glade2 and fixed by bootstrap */
709 -e 's#_(\(".:..:.."\))#\1#' \
710 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
711 -e 's#_("---")#"---"#' \
712 -e 's#_("--")#"--"#' \
713 -e 's#_(\("/dev/[^"]*"\))#\1#' \
714 -e 's#_(\("./."\))#\1#' \
715 < $file >> $file.$$.bak
716 mv -f $file.$$.bak $file
726 if test "${action}" = "distclean"
729 # a naive sanity check to make sure we are in a VLC tree
730 test -f vlc.spec.mdk -a -f debian/rules || exit 1
732 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 '{}' ';'
733 (cd autotools && find . -name '[a-z]*' -maxdepth 1 -exec rm -f '{}' ';')
734 (cd debian && find . -type d '(' -name '[a-z]*' ! -name 'patches' ')' -maxdepth 1 -exec rm -Rf '{}' ';')
735 find msvc -type f -name '*.dsp' -exec rm -f '{}' ';'
736 find evc -type f -name '*.vcp' -exec rm -f '{}' ';'
737 find . -type d -name '.deps' -exec rm -Rf '{}' ';'
738 # there's some more cruft all around
739 rm -f config.h config.log config.status
740 rm -f vlc vlc-config Makefile Modules.am
741 rm -Rf autom4te.cache
742 rm -f mozilla/vlcintf.h mozilla/vlcintf.xpt
743 # FIXME: a lot of Makefiles are still there
747 ## Add the extras/contrib dir to the distribution
749 if test "${action}" = "contrib"
752 if test ! -d "${distdir}/extras"
754 mkdir "${distdir}/extras"
756 if test ! -d "${distdir}/extras/contrib"
758 mkdir "${distdir}/extras/contrib"
760 cp "${srcdir}/extras/contrib/Makefile" "${distdir}/extras/contrib/Makefile"
761 cp "${srcdir}/extras/contrib/README" "${distdir}/extras/contrib/README"
762 cp "${srcdir}/extras/contrib/bootstrap" "${distdir}/extras/contrib/bootstrap"
763 cp "${srcdir}/extras/contrib/change_prefix.sh" "${distdir}/extras/contrib/change_prefix.sh"
764 if test ! -d "${distdir}/extras/contrib/src"
766 mkdir "${distdir}/extras/contrib/src"
768 cp "${srcdir}/extras/contrib/src/Makefile" "${distdir}/extras/contrib/src/Makefile"
769 cp "${srcdir}/extras/contrib/src/packages.mak" "${distdir}/extras/contrib/src/packages.mak"
770 if test ! -d "${distdir}/extras/contrib/src/Patches"
772 mkdir "${distdir}/extras/contrib/src/Patches"
774 cp ${srcdir}/extras/contrib/src/Patches/* "${distdir}/extras/contrib/src/Patches/"
778 ## Build a woody-friendly package
780 if test "${action}" = "woody"
785 # changelog: replace (1.2.3-4) with (1.2.3-0woody.4)
786 sed -e 's/^vlc (\([^)]*\)-\([^-)]*\))/vlc-woody (\1-0woody.\2)/' \
787 -e 's/ unstable; / stable; /' \
788 < "$1/debian/changelog" > "$1/debian/changelog.woody"
789 mv "$1/debian/changelog.woody" "$1/debian/changelog"
791 # control: replace liba52-*-dev with a52dec-dev (>=0.7.3)
792 # libdv*-dev with libdv-dev
793 # kdelibs4-dev with kdelibs-dev
794 # libqt3-mt-dev libqt3-compat-headers with libqt-dev
795 # libarts1-dev with libarts-dev
796 # libdvdread3-dev with libdvdread2-dev
797 # libdvdplay0-dev (>=1.0.1-2) with libdvdplay0-dev
798 # libxosd-dev (>=2.2.4-1.3) with libxosd-dev
799 # ttf-freefont with ttf-thryomanes
800 # dvb-dev (>= 1.0.1-6) with dvb-dev
801 # remove libwxgtk2.4-dev
802 # libidl0 (workaround for mozilla-dev's bad deps)
803 # libglib2.0-0 (workaround for mozilla-dev's bad deps)
804 # gcc-3.2 (workaround for an ICE in gcc-3.3)
805 # change Section: gnome with Section: graphics
806 # Section: kde with Section: kde
807 # Section: libdevel with Section: devel
808 sed -e 's/liba52-[^-]*-dev/a52dec-dev (>=0.7.3)/' \
809 -e 's/libdv[0-9]*-dev/libdv-dev/' \
810 -e 's/kdelibs[0-9]*-dev/kdelibs-dev/' \
811 -e 's/libqt[0-9]*-mt-dev/libqt-dev/' \
812 -e 's/, libqt[0-9]*-compat-headers[^,]*//' \
813 -e 's/libarts[0-9]*-dev/libarts-dev/' \
814 -e 's/libdvdread[0-9]*-dev/libdvdread2-dev/' \
815 -e 's/, libdvdplay0-dev[^,]*/, libdvdplay0-dev/' \
816 -e 's/, libxosd-dev[^,]*/, libxosd-dev/' \
817 -e 's/, ttf-freefont[^,]*/, ttf-thryomanes/' \
818 -e 's/, dvb-dev[^,]*/, dvb-dev/' \
819 -e 's/, libwx[^,]*//' \
820 -e '/Package: wxvlc/,/^ *$/d' \
821 -e 's/, libidl0[^,]*//' \
822 -e 's/, libglib2.0-0[^,]*//' \
823 -e 's/, gcc-3.2[^,]*//' \
824 -e 's/Section: gnome/Section: graphics/' \
825 -e 's/Section: kde/Section: graphics/' \
826 -e 's/Section: libdevel/Section: devel/' \
827 < "$1/debian/control" > "$1/debian/control.woody"
828 mv "$1/debian/control.woody" "$1/debian/control"
830 # rules: remove wxwindows and skins stuff
831 sed -e '/# Package: wxvlc/,/^ *$/d' \
832 -e 's,--enable-wxwindows,--disable-wxwindows,' \
833 -e 's,--enable-skins,--disable-skins,' \
834 < "$1/debian/rules" > "$1/debian/rules.woody"
835 mv "$1/debian/rules.woody" "$1/debian/rules"
836 chmod 0755 "$1/debian/rules"
838 # modules/misc/freetype.c: replace the default font
839 sed -e 's,freefont/FreeSerifBold.ttf,thryomanes/thryb___.ttf,' \
840 < "$1/modules/misc/freetype.c" > "$1/modules/misc/freetype.c.woody"
841 mv "$1/modules/misc/freetype.c.woody" "$1/modules/misc/freetype.c"