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"
560 cat "${srcdir}/src/misc/modules_builtin.h.in" > "${file}.tmp" || exit 1
561 if test -n "${BUILTINS}"
563 for i in `echo ${BUILTINS}`
565 echo "int vlc_entry__`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`( module_t* );" >> "${file}.tmp"
567 echo "" >> "${file}.tmp"
569 echo "#define ALLOCATE_ALL_BUILTINS() \\" >> ${file}.tmp
570 echo " do \\" >> "${file}.tmp"
571 echo " { \\" >> "${file}.tmp"
572 if test -n "${BUILTINS}"
574 for i in `echo ${BUILTINS}`
576 echo " ALLOCATE_BUILTIN(`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`); \\" >> "${file}.tmp"
579 echo " } while( 0 );" >> "${file}.tmp"
580 echo "" >> "${file}.tmp" || exit 1
581 if diff >/dev/null 2>&1 "${file}" "${file}.tmp"
585 echo "creating new ${file}"
586 mv -f "${file}.tmp" "${file}"
593 ## Create version file
595 if test "${action}" = "version"
597 if test -z "${srcdir}"; then
598 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
600 if test -z "${builddir}"; then
601 builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`"
603 if test -z "${CC}"; then
604 CC="`sed -ne 's/^CC *= *//p' < Makefile`"
607 file="${builddir}/src/misc/version.c"
608 if which svnversion 2>&1 >/dev/null; then
609 VLC_CHANGESET=`svnversion $srcdir`
611 VLC_CHANGESET='exported'
615 cat > ${file}.tmp << EOF
616 /* DO NOT EDIT THIS FILE - IT IS REGENERATED AT EVERY COMPILE -
617 * IT GIVES BETTER TRACKING OF VLC STABLE AND DEVELOPMENT VERSIONS
618 * WHETHER THEY ARE BUILT BY OTHERS OR DURING DEVELOPMENT OR FOR THE
619 * OFFICIAL VLC STABLE RELEASES.
621 const char psz_vlc_changeset[] = "${VLC_CHANGESET}";
624 if diff >/dev/null 2>&1 ${file} ${file}.tmp
628 echo "creating new ${file}"
629 mv -f ${file}.tmp ${file}
636 ## Fix glade-generated files
638 if test "${action}" = "glade"
640 for file in modules/gui/gtk/gnome.glade modules/gui/gtk/gtk.glade modules/gui/familiar/familiar.glade
642 echo "generating code from $file"
643 glade -w $file || exit 1
646 for file in modules/gui/gtk/gnome_interface.c modules/gui/gtk/gtk_interface.c modules/gui/familiar/interface.c
649 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
652 cat > $file.$$.bak << EOF
653 /* This file was created automatically by glade and fixed by bootstrap */
658 -e 's#_(\(".:..:.."\))#\1#' \
659 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
660 -e 's#_("---")#"---"#' \
661 -e 's#_("--")#"--"#' \
662 -e 's#_(\("/dev/[^"]*"\))#"\1"#' \
663 -e 's#_(\("./."\))#\1#' \
664 < $file >> $file.$$.bak
665 mv -f $file.$$.bak $file
669 for file in modules/gui/gtk/gtk_support.h modules/gui/familiar/support.h
672 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
675 sed -e 's/DO NOT EDIT.*/Created by glade, fixed by bootstrap/' \
676 -e 's,<config.h>,<vlc/vlc.h>,' \
677 -e 's,#if.*ENABLE_NLS.*,#if 0 /* Disabled by bootstrap */,' \
678 -e 's,#else,/* & */,' \
679 < $file > $file.$$.bak
680 mv -f $file.$$.bak $file
688 ## Fix glade2-generated files
690 if test "${action}" = "glade2"
692 for file in modules/gui/gtk2/gnome2.glade modules/gui/gtk2/gtk2.glade modules/gui/pda/pda.glade
694 echo "generating code from $file"
695 glade-2 -w $file || exit 1
698 for file in modules/gui/pda/pda_interface.c
701 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
704 cat > $file.$$.bak << EOF
705 /* This file was created automatically by glade2 and fixed by bootstrap */
710 -e 's#_(\(".:..:.."\))#\1#' \
711 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
712 -e 's#_("---")#"---"#' \
713 -e 's#_("--")#"--"#' \
714 -e 's#_(\("/dev/[^"]*"\))#\1#' \
715 -e 's#_(\("./."\))#\1#' \
716 < $file >> $file.$$.bak
717 mv -f $file.$$.bak $file
727 if test "${action}" = "distclean"
730 # a naive sanity check to make sure we are in a VLC tree
731 test -f vlc.spec.mdk -a -f debian/rules || exit 1
733 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 '{}' ';'
734 (cd autotools && find . -name '[a-z]*' -maxdepth 1 -exec rm -f '{}' ';')
735 (cd debian && find . -type d '(' -name '[a-z]*' ! -name 'patches' ')' -maxdepth 1 -exec rm -Rf '{}' ';')
736 find msvc -type f -name '*.dsp' -exec rm -f '{}' ';'
737 find evc -type f -name '*.vcp' -exec rm -f '{}' ';'
738 find . -type d -name '.deps' -exec rm -Rf '{}' ';'
739 # there's some more cruft all around
740 rm -f config.h config.log config.status
741 rm -f vlc vlc-config Makefile Modules.am
742 rm -Rf autom4te.cache
743 rm -f mozilla/vlcintf.h mozilla/vlcintf.xpt
744 # FIXME: a lot of Makefiles are still there
748 ## Add the extras/contrib dir to the distribution
750 if test "${action}" = "contrib"
753 if test ! -d "${distdir}/extras"
755 mkdir "${distdir}/extras"
757 if test ! -d "${distdir}/extras/contrib"
759 mkdir "${distdir}/extras/contrib"
761 cp "${srcdir}/extras/contrib/Makefile" "${distdir}/extras/contrib/Makefile"
762 cp "${srcdir}/extras/contrib/README" "${distdir}/extras/contrib/README"
763 cp "${srcdir}/extras/contrib/bootstrap" "${distdir}/extras/contrib/bootstrap"
764 cp "${srcdir}/extras/contrib/change_prefix.sh" "${distdir}/extras/contrib/change_prefix.sh"
765 if test ! -d "${distdir}/extras/contrib/src"
767 mkdir "${distdir}/extras/contrib/src"
769 cp "${srcdir}/extras/contrib/src/Makefile" "${distdir}/extras/contrib/src/Makefile"
770 cp "${srcdir}/extras/contrib/src/packages.mak" "${distdir}/extras/contrib/src/packages.mak"
771 if test ! -d "${distdir}/extras/contrib/src/Patches"
773 mkdir "${distdir}/extras/contrib/src/Patches"
775 cp ${srcdir}/extras/contrib/src/Patches/* "${distdir}/extras/contrib/src/Patches/"
779 ## Build a woody-friendly package
781 if test "${action}" = "woody"
786 # changelog: replace (1.2.3-4) with (1.2.3-0woody.4)
787 sed -e 's/^vlc (\([^)]*\)-\([^-)]*\))/vlc-woody (\1-0woody.\2)/' \
788 -e 's/ unstable; / stable; /' \
789 < "$1/debian/changelog" > "$1/debian/changelog.woody"
790 mv "$1/debian/changelog.woody" "$1/debian/changelog"
792 # control: replace liba52-*-dev with a52dec-dev (>=0.7.3)
793 # libdv*-dev with libdv-dev
794 # kdelibs4-dev with kdelibs-dev
795 # libqt3-mt-dev libqt3-compat-headers with libqt-dev
796 # libarts1-dev with libarts-dev
797 # libdvdread3-dev with libdvdread2-dev
798 # libdvdplay0-dev (>=1.0.1-2) with libdvdplay0-dev
799 # libxosd-dev (>=2.2.4-1.3) with libxosd-dev
800 # ttf-freefont with ttf-thryomanes
801 # dvb-dev (>= 1.0.1-6) with dvb-dev
802 # remove libwxgtk2.4-dev
803 # libidl0 (workaround for mozilla-dev's bad deps)
804 # libglib2.0-0 (workaround for mozilla-dev's bad deps)
805 # gcc-3.2 (workaround for an ICE in gcc-3.3)
806 # change Section: gnome with Section: graphics
807 # Section: kde with Section: kde
808 # Section: libdevel with Section: devel
809 sed -e 's/liba52-[^-]*-dev/a52dec-dev (>=0.7.3)/' \
810 -e 's/libdv[0-9]*-dev/libdv-dev/' \
811 -e 's/kdelibs[0-9]*-dev/kdelibs-dev/' \
812 -e 's/libqt[0-9]*-mt-dev/libqt-dev/' \
813 -e 's/, libqt[0-9]*-compat-headers[^,]*//' \
814 -e 's/libarts[0-9]*-dev/libarts-dev/' \
815 -e 's/libdvdread[0-9]*-dev/libdvdread2-dev/' \
816 -e 's/, libdvdplay0-dev[^,]*/, libdvdplay0-dev/' \
817 -e 's/, libxosd-dev[^,]*/, libxosd-dev/' \
818 -e 's/, ttf-freefont[^,]*/, ttf-thryomanes/' \
819 -e 's/, dvb-dev[^,]*/, dvb-dev/' \
820 -e 's/, libwx[^,]*//' \
821 -e '/Package: wxvlc/,/^ *$/d' \
822 -e 's/, libidl0[^,]*//' \
823 -e 's/, libglib2.0-0[^,]*//' \
824 -e 's/, gcc-3.2[^,]*//' \
825 -e 's/Section: gnome/Section: graphics/' \
826 -e 's/Section: kde/Section: graphics/' \
827 -e 's/Section: libdevel/Section: devel/' \
828 < "$1/debian/control" > "$1/debian/control.woody"
829 mv "$1/debian/control.woody" "$1/debian/control"
831 # rules: remove wxwindows and skins stuff
832 sed -e '/# Package: wxvlc/,/^ *$/d' \
833 -e 's,--enable-wxwindows,--disable-wxwindows,' \
834 -e 's,--enable-skins,--disable-skins,' \
835 < "$1/debian/rules" > "$1/debian/rules.woody"
836 mv "$1/debian/rules.woody" "$1/debian/rules"
837 chmod 0755 "$1/debian/rules"
839 # modules/misc/freetype.c: replace the default font
840 sed -e 's,freefont/FreeSerifBold.ttf,thryomanes/thryb___.ttf,' \
841 < "$1/modules/misc/freetype.c" > "$1/modules/misc/freetype.c.woody"
842 mv "$1/modules/misc/freetype.c.woody" "$1/modules/misc/freetype.c"