4 ## toolbox for the VLC media player
7 ## Copyright (C) 2002-2006 the VideoLAN team
9 ## Authors: Samuel Hocevar <sam@zoy.org>
10 ## RĂ©mi Denis-Courmont <rem # videolan.org>
13 ### Get a sane environment, just in case
29 --update-vc update Microsoft Visual Studio files
30 --update-vc7 update Microsoft Visual .NET files
31 --update-po update translation files
32 --update-includes generate various include files
33 --update-version generate src/misc/version.c
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
43 ## Extract stuff from Makefile.am
47 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" | \
49 sed -ne 's/[^-$()_a-zA-Z0-9][^-$()_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p' | \
50 sed -e "s,^,${srcdir}/,"
63 --changelog|--update-changelog)
84 --update-glade2|--update-glade-2|--fix-glade2)
100 echo "$0: unknown option $1"
107 ## Add includes to help doxygen
109 if test "${action}" = "include"
112 */vlc_common.h|*/include/vlc/*);;
113 */include/*.h) echo "#include <vlc_common.h>" ;;
120 ## Update the CVS changelog
122 if test "${action}" = "changelog"
125 echo "toolbox --changelog no longer required. use this instead:"
126 echo " LANG=C svn log -v -r '{$YEAR-12-31}:{$YEAR-01-01}' > ChangeLog"
131 ## Update the MSVC project files
133 if test "${action}" = "vc"
135 echo "generating Visual Studio files"
137 if test -z "${srcdir}"; then
138 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
141 # The evil ^M. printf '\r' does not work in Cygwin.
144 # Variables we get from configure.ac
145 LIBVLC_VERSION=`sed -ne '/AC_INIT/s/.*,\(.*\))/\1/p' < configure.ac`
146 LIBVLC_CODENAME=`sed -ne '/CODENAME=/s/.*"\(.*\)"/\1/p' < configure.ac`
147 LIBVLC_SYMBOL=`echo $LIBVLC_VERSION | sed -e 'y/.-/__/'`
149 # Sources that get built under Win32 - FIXME: anyone wanna deuglify this? :)
150 LIBVLC_SOURCES=`getfiles SOURCES_libvlc_common; getfiles SOURCES_libvlc_win32; getfiles SOURCES_libvlc_dirent; getfiles SOURCES_libvlc_getopt; getfiles SOURCES_libvlc_libc`
152 LIBVLC_HEADERS=`getfiles HEADERS_include; getfiles HEADERS_include_built`
154 LIBVLC_PKG_HEADERS=`getfiles dist_pkginclude_HEADERS`
157 rm -f evc/*.vcp msvc/*.dsp msvc/*.vcproj msvc/*.sln msvc/*.ncb
160 for target in evc/config.h msvc/config.h
164 sed -e "s/@CODENAME@/${LIBVLC_CODENAME}/" \
165 -e "s/@VERSION@/${LIBVLC_VERSION}/" \
166 -e "s/@SYMBOL@/${LIBVLC_SYMBOL}/" < ${target}.in > ${target}
170 for target in evc/libvlc.vcp msvc/libvlc.dsp
173 # Top of the project file
174 perl -pe 'if(/ZSOURCESZ/){last;}' < ${target}.in > ${target}
176 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep -v "/.*/"`
178 cat >> ${target} << EOF
179 # Begin Source File${M}
180 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
181 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
182 # End Source File${M}
185 for subdir in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/.*/" | cut -f2 -d/ | sort | uniq`
187 cat >> ${target} << EOF
188 # Begin Group "${subdir}"${M}
190 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/${subdir}/"`
192 subdir="`echo ${file} | sed -e 's%/[^/]*$%/%' | sed -e 's%/%\\\\%g'`"
193 if test "${target}" = "evc/libvlc.vcp"
195 cat >> ${target} << EOF
196 # Begin Source File${M}
197 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
198 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
199 !IF "\$(CFG)" == "libvlc - Win32 (WCE MIPS) Release"${M}
200 # PROP Output_Dir "MIPSRel\\${subdir}"${M}
201 # PROP Intermediate_Dir "MIPSRel\\${subdir}"${M}
202 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE MIPS) Debug"${M}
203 # PROP Output_Dir "MIPSDbg\\${subdir}"${M}
204 # PROP Intermediate_Dir "MIPSDbg\\${subdir}"${M}
205 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH4) Release"${M}
206 # PROP Output_Dir "SH4Rel\\${subdir}"${M}
207 # PROP Intermediate_Dir "SH4Rel\\${subdir}"${M}
208 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH4) Debug"${M}
209 # PROP Output_Dir "SH4Dbg\\${subdir}"${M}
210 # PROP Intermediate_Dir "SH4Dbg\\${subdir}"${M}
211 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH3) Release"${M}
212 # PROP Output_Dir "SH3Rel\\${subdir}"${M}
213 # PROP Intermediate_Dir "SH3Rel\\${subdir}"${M}
214 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH3) Debug"${M}
215 # PROP Output_Dir "SH3Dbg\\${subdir}"${M}
216 # PROP Intermediate_Dir "SH3Dbg\\${subdir}"${M}
217 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARM) Release"${M}
218 # PROP Output_Dir "ARMRel\\${subdir}"${M}
219 # PROP Intermediate_Dir "ARMRel\\${subdir}"${M}
220 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARM) Debug"${M}
221 # PROP Output_Dir "ARMDbg\\${subdir}"${M}
222 # PROP Intermediate_Dir "ARMDbg\\${subdir}"${M}
223 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARMV4) Release"${M}
224 # PROP Output_Dir "ARMV4Rel\\${subdir}"${M}
225 # PROP Intermediate_Dir "ARMV4Rel\\${subdir}"${M}
226 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARMV4) Debug"${M}
227 # PROP Output_Dir "ARMV4Dbg\\${subdir}"${M}
228 # PROP Intermediate_Dir "ARMV4Dbg\\${subdir}"${M}
229 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86em) Release"${M}
230 # PROP Output_Dir "X86EMRel\\${subdir}"${M}
231 # PROP Intermediate_Dir "X86EMRel\\${subdir}"${M}
232 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86em) Debug"${M}
233 # PROP Output_Dir "X86EMDbg\\${subdir}"${M}
234 # PROP Intermediate_Dir "X86EMDbg\\${subdir}"${M}
235 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE emulator) Debug"${M}
236 # PROP Output_Dir "emulatorDbg\\${subdir}"${M}
237 # PROP Intermediate_Dir "emulatorDbg\\${subdir}"${M}
238 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE emulator) Release"${M}
239 # PROP Output_Dir "emulatorRel\\${subdir}"${M}
240 # PROP Intermediate_Dir "emulatorRel\\${subdir}"${M}
241 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86) Debug"${M}
242 # PROP Output_Dir "X86Dbg\\${subdir}"${M}
243 # PROP Intermediate_Dir "X86Dbg\\${subdir}"${M}
244 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86) Release"${M}
245 # PROP Output_Dir "X86Rel\\${subdir}"${M}
246 # PROP Intermediate_Dir "X86Rel\\${subdir}"${M}
248 # End Source File${M}
251 cat >> ${target} << EOF
252 # Begin Source File${M}
253 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
254 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
255 !IF "\$(CFG)" == "libvlc - Win32 Release"${M}
256 # PROP Output_Dir "Release\\${subdir}"${M}
257 # PROP Intermediate_Dir "Release\\${subdir}"${M}
258 !ELSEIF "\$(CFG)" == "libvlc - Win32 Debug"${M}
259 # PROP Output_Dir "Debug\\${subdir}"${M}
260 # PROP Intermediate_Dir "Debug\\${subdir}"${M}
262 # End Source File${M}
266 cat >> ${target} << EOF
271 perl -e 'while(<>){if(/ZSOURCESZ/){last;}}while(<>){if(/ZHEADERSZ/){last;}print $_}' < ${target}.in >> ${target}
272 for file in ${LIBVLC_HEADERS}
274 cat >> ${target} << EOF
275 # Begin Source File${M}
276 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
277 # End Source File${M}
280 cat >> ${target} << EOF
281 # Begin Group "vlc"${M}
283 for file in ${LIBVLC_PKG_HEADERS}
285 cat >> ${target} << EOF
286 # Begin Source File${M}
287 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
288 # End Source File${M}
291 cat >> ${target} << EOF
294 perl -e 'while(<>){if(/ZHEADERSZ/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
298 for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' ${srcdir}/configure.ac`
300 mf="${srcdir}/modules/${dir}/Modules.am"
301 for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
303 # this is an attempt at getting a list of plugin sources... we take the
304 # production and remove everything that does not contain "module", which
305 # means you miss $(NULL), but other variables too.
306 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 '\.'`
307 hfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep '\.h$'`
308 cfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep -v '\.h$'`
309 for msdir in evc msvc
311 test "${msdir}" = "evc" && suf="vcp" || suf="dsp"
312 source="${msdir}/plugins.${suf}.in"
313 target="${msdir}/plugin_${mod}.${suf}"
315 perl -pe 'if(/ZSOURCESZ/){last;} s/ZPLUGINZ/'${mod}'/g' < ${source} > ${target}
316 for cfile in ${cfiles}
318 cat >> ${target} << EOF
319 # Begin Source File${M}
320 SOURCE="..\\modules\\`echo ${dir}/${cfile} | sed 's,/,\\\\,g'`"${M}
321 # ADD CPP /D "__VLC__" /D "__PLUGIN__" /D "MODULE_NAME=${mod}" /D "MODULE_NAME_IS_${mod}" ${M}
322 !IF "\$(CFG)" == "plugin_${mod} - Win32 Release"${M}
323 # PROP Output_Dir "Release\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
324 # PROP Intermediate_Dir "Release\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
325 !ELSEIF "\$(CFG)" == "plugin_${mod} - Win32 Debug"${M}
326 # PROP Output_Dir "Debug\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
327 # PROP Intermediate_Dir "Debug\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
328 # End Source File${M}
331 # sed is really nicer for this... unfortunately it's broken under cygwin
332 # sed -ne '1,/ZSOURCESZ/d; /ZHEADERSZ/,$d; p' < ${source} >> ${target}
333 perl -e 'while(<>){if(/ZSOURCESZ/){last;}}while(<>){if(/ZHEADERSZ/){last;}print $_}' < ${source} >> ${target}
334 for hfile in ${hfiles}
336 cat >> ${target} << EOF
337 # Begin Source File${M}
338 SOURCE="..\\modules\\`echo ${dir}/${hfile} | sed 's,/,\\\\,g'`"${M}
339 # End Source File${M}
342 # sed -ne '1,/ZHEADERSZ/d; p' < ${source} >> ${target}
343 perl -e 'while(<>){if(/ZHEADERSZ/){last;}}while(<>){print $_}' < ${source} >> ${target}
349 for target in evc/vlc.vcp msvc/vlc.dsp
352 # Top of the project file
353 perl -pe 'if(/ZSOURCESZ/){last;}' < ${target}.in > ${target}
355 cat >> ${target} << EOF
356 # Begin Source File${M}
357 SOURCE="..\\src\\vlc.c"${M}
358 # End Source File${M}
360 # Bottom of the project file - handles resource files too
361 perl -e 'while(<>){if(/ZSOURCESZ/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
369 ## Update the MSVC (.NET) project files
371 if test "${action}" = "vc7"
373 echo "generating Visual .NET files"
377 # The evil ^M. printf '\r' does not work in Cygwin.
381 # Variables we get from configure.ac
382 LIBVLC_VERSION=`sed -ne '/AC_INIT/s/.*,\(.*\))/\1/p' < configure.ac`
383 LIBVLC_CODENAME=`sed -ne '/CODENAME=/s/.*"\(.*\)"/\1/p' < configure.ac`
384 LIBVLC_SYMBOL=`echo $LIBVLC_VERSION | sed -e 'y/.-/__/'`
386 # Sources that get built under Win32 - FIXME: anyone wanna deuglify this? :)
387 LIBVLC_SOURCES=`getfiles SOURCES_libvlc_common; getfiles SOURCES_libvlc_win32; getfiles SOURCES_libvlc_dirent; getfiles SOURCES_libvlc_getopt; getfiles SOURCES_libvlc_libc`
389 LIBVLC_HEADERS=`getfiles HEADERS_include; getfiles HEADERS_include_built`
391 LIBVLC_PKG_HEADERS=`getfiles dist_pkginclude_HEADERS`
397 for target in msvc/config.h
401 sed -e "s/@CODENAME@/${LIBVLC_CODENAME}/" \
402 -e "s/@VERSION@/${LIBVLC_VERSION}/" \
403 -e "s/@SYMBOL@/${LIBVLC_SYMBOL}/" < ${target}.in > ${target}
407 target="msvc/vlc.vcproj"
409 # Top of the project file
410 guid=`perl -e 'sub r {return sprintf("%X", int rand(65536))} print r.r."-".r."-".r."-".r."-".r.r.r'`
411 perl -pe 'if(/ZSOURCESZ/){last;} s/ZGUIDZ/'${guid}'/g' < ${target}.in > ${target}
413 cat >> ${target} << EOF
414 <File RelativePath="..\\src\\vlc.c"></File>${M}
416 # Bottom of the project file - handles resource files too
417 perl -e 'while(<>){if(/ZSOURCESZ/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
420 target=msvc/libvlc.vcproj
422 # Top of the project file
423 guid=`perl -e 'sub r {return sprintf("%X", int rand(65536))} print r.r."-".r."-".r."-".r."-".r.r.r'`
424 perl -pe 'if(/ZSOURCESZ/){last;} s/ZGUIDZ/'${guid}'/g' < ${target}.in > ${target}
426 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep -v "/.*/"`
428 cat >> ${target} << EOF
429 <File RelativePath="..\\`echo ${dir}/${file} | sed 's,/,\\\\,g'`"></File>${M}
432 for subdir in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/.*/" | cut -f2 -d/ | sort | uniq`
434 cat >> ${target} << EOF
435 <Filter Name="`echo ${subdir} | sed s,/,_,g`" Filter="c;cpp">${M}
437 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/${subdir}/"`
439 cat >> ${target} << EOF
440 <File RelativePath="..\\`echo ${file} | sed 's,/,\\\\,g'`">${M}
442 if echo ${file} | grep -q '.c$'
444 cat >> ${target} << EOF
445 <FileConfiguration Name="Debug|Win32">${M}
446 <Tool Name="VCCLCompilerTool" ObjectFile="\$(IntDir)/\$(ProjectName)/`echo ${file} | sed -e s/\.c$/.obj/`"/>${M}
447 </FileConfiguration>${M}
450 cat >> ${target} << EOF
454 cat >> ${target} << EOF
459 perl -e 'while(<>){if(/ZSOURCESZ/){last;}}while(<>){if(/ZHEADERSZ/){last;}print $_}' < ${target}.in >> ${target}
460 for file in ${LIBVLC_HEADERS}
462 cat >> ${target} << EOF
463 <File RelativePath="..\\`echo ${file} | sed 's,/,\\\\,g'`"></File>${M}
466 cat >> ${target} << EOF
467 <Filter Name="vlc" Filter="h;hpp">${M}
469 for file in ${LIBVLC_PKG_HEADERS}
471 cat >> ${target} << EOF
472 <File RelativePath="..\\`echo ${file} | sed 's,/,\\\\,g'`"></File>${M}
475 cat >> ${target} << EOF
478 perl -e 'while(<>){if(/ZHEADERSZ/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
481 for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' ${srcdir}/configure.ac`
483 mf="${srcdir}/modules/${dir}/Modules.am"
484 for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
486 # this is an attempt at getting a list of plugin sources... we take the
487 # production and remove everything that does not contain "module", which
488 # means you miss $(NULL), but other variables too.
489 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 '\.'`
490 hfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep '\.h$'`
491 cfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep -v '\.h$'`
494 source="${msdir}/plugins.vcproj.in"
495 target="${msdir}/plugin_${mod}.vcproj"
497 guid=`perl -e 'sub r {return sprintf("%X", int rand(65536))} print r.r."-".r."-".r."-".r."-".r.r.r'`
498 perl -pe 'if(/ZSOURCESZ/){last;} s/ZPLUGINZ/'${mod}'/g' < ${source} | sed 's,ZGUIDZ,'${guid}',' > ${target}
499 for cfile in ${cfiles}
501 cat >> ${target} << EOF
502 <File RelativePath="..\\modules\\`echo ${dir}/${cfile} | sed 's,/,\\\\,g'`"></File>${M}
505 # sed is really nicer for this... unfortunately it's broken under cygwin
506 # sed -ne '1,/ZSOURCESZ/d; /ZHEADERSZ/,$d; p' < ${source} >> ${target}
507 perl -e 'while(<>){if(/ZSOURCESZ/){last;}}while(<>){if(/ZHEADERSZ/){last;}print $_}' < ${source} >> ${target}
508 for hfile in ${hfiles}
510 cat >> ${target} << EOF
511 <File RelativePath="..\\modules\\`echo ${dir}/${hfile} | sed 's,/,\\\\,g'`"></File>${M}
514 # sed -ne '1,/ZHEADERSZ/d; p' < ${source} >> ${target}
515 perl -e 'while(<>){if(/ZHEADERSZ/){last;}}while(<>){print $_}' < ${source} >> ${target}
525 ## Update the potfiles because no one ever does it
527 if test "${action}" = "po"
529 # find out the source files
530 echo "WARNING: you should run \"make update-po\" instead!" >&2
536 ## Create include files
538 if test "${action}" = "includes"
542 if test -z "${srcdir}"; then
543 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
545 if test -z "${builddir}"; then
546 builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`"
548 BUILTINS=`sed -ne 's/.*builtins *= *" *\([^"]*\)".*/\1/p' ${builddir}/vlc-config`
550 file="${builddir}/src/misc/modules_builtin.h"
553 mkdir -p -- "${builddir}/src/misc"
554 cat "${srcdir}/src/misc/modules_builtin.h.in" > "${file}.tmp" || exit 1
555 if test -n "${BUILTINS}"
557 for i in `echo ${BUILTINS}`
559 echo "int vlc_entry__`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`( module_t* );" >> "${file}.tmp"
561 echo "" >> "${file}.tmp"
563 echo "#define ALLOCATE_ALL_BUILTINS() \\" >> ${file}.tmp
564 echo " do \\" >> "${file}.tmp"
565 echo " { \\" >> "${file}.tmp"
566 if test -n "${BUILTINS}"
568 for i in `echo ${BUILTINS}`
570 echo " ALLOCATE_BUILTIN(`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`); \\" >> "${file}.tmp"
573 echo " } while( 0 );" >> "${file}.tmp"
574 echo "" >> "${file}.tmp" || exit 1
575 if diff >/dev/null 2>&1 "${file}" "${file}.tmp"
579 echo "creating new ${file}"
580 mv -f "${file}.tmp" "${file}"
587 ## Create version file
589 if test "${action}" = "version"
591 if test -z "${srcdir}"; then
592 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
594 if test -z "${builddir}"; then
595 builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`"
597 if test -z "${CC}"; then
598 CC="`sed -ne 's/^CC *= *//p' < Makefile`"
601 file="${builddir}/src/misc/version.c"
602 if which svnversion 2>&1 >/dev/null; then
603 VLC_CHANGESET=`svnversion $srcdir`
605 VLC_CHANGESET='exported'
609 mkdir -p -- "${builddir}/src/misc"
610 cat > ${file}.tmp << EOF
611 /* DO NOT EDIT THIS FILE - IT IS REGENERATED AT EVERY COMPILE -
612 * IT GIVES BETTER TRACKING OF VLC STABLE AND DEVELOPMENT VERSIONS
613 * WHETHER THEY ARE BUILT BY OTHERS OR DURING DEVELOPMENT OR FOR THE
614 * OFFICIAL VLC STABLE RELEASES.
616 const char psz_vlc_changeset[] = "${VLC_CHANGESET}";
619 if diff >/dev/null 2>&1 ${file} ${file}.tmp
623 echo "creating new ${file}"
624 mv -f ${file}.tmp ${file}
631 ## Fix glade2-generated files
633 if test "${action}" = "glade2"
635 file="modules/gui/pda/pda.glade"
636 echo "generating code from $file"
637 glade-2 -w "$file" || exit 1
639 file="modules/gui/pda/pda_interface.c"
641 if grep "DO NOT EDIT THIS FILE" "$file" >/dev/null 2>&1
643 rm -f -- "$file.$$.bak"
644 cat > "$file.$$.bak" << EOF
645 /* This file was created automatically by glade2 and fixed by bootstrap */
650 -e 's#_(\(".:..:.."\))#\1#' \
651 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
652 -e 's#_("---")#"---"#' \
653 -e 's#_("--")#"--"#' \
654 -e 's#_(\("/dev/[^"]*"\))#\1#' \
655 -e 's#_(\("./."\))#\1#' \
656 < "$file" >> "$file.$$.bak"
657 mv -f "$file.$$.bak" "$file"
666 if test "${action}" = "distclean"
669 # a naive sanity check to make sure we are in a VLC tree
670 test -f vlc.spec.mdk -a -f vlc.win32.nsi.in || exit 1
672 find . -type f '(' -name '*.[oa]' -o -name '*.l[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 '{}' ';'
673 (cd autotools && find . -maxdepth 1 -name '[a-z]*' -exec rm -f '{}' ';')
674 find msvc -type f -name '*.dsp' -exec rm -f '{}' ';'
675 find evc -type f -name '*.vcp' -exec rm -f '{}' ';'
676 find . -type d -name '.deps' -exec rm -Rf '{}' ';'
677 find . -type d -name '.libs' -exec rm -Rf '{}' ';'
678 # there's some more cruft all around
679 rm -f config.h config.log config.status
680 rm -f vlc vlc-config Makefile Modules.am
681 rm -Rf autom4te.cache
682 rm -f mozilla/vlcintf.h mozilla/vlcintf.xpt
683 echo "\`toolbox --distclean\' is known to be broken."
684 echo "Don't complain if it does not work, or better yet, don't use it."
685 echo "You were warned."
686 # FIXME: a lot of Makefiles are still there
690 ## Add the extras/contrib dir to the distribution
692 if test "${action}" = "contrib"
695 if test ! -d "${distdir}/extras"
697 mkdir "${distdir}/extras"
699 if test ! -d "${distdir}/extras/contrib"
701 mkdir "${distdir}/extras/contrib"
703 cp "${srcdir}/extras/contrib/Makefile" "${distdir}/extras/contrib/Makefile"
704 cp "${srcdir}/extras/contrib/README" "${distdir}/extras/contrib/README"
705 cp "${srcdir}/extras/contrib/bootstrap" "${distdir}/extras/contrib/bootstrap"
706 cp "${srcdir}/extras/contrib/change_prefix.sh" "${distdir}/extras/contrib/change_prefix.sh"
707 if test ! -d "${distdir}/extras/contrib/src"
709 mkdir "${distdir}/extras/contrib/src"
711 cp "${srcdir}/extras/contrib/src/Makefile" "${distdir}/extras/contrib/src/Makefile"
712 cp "${srcdir}/extras/contrib/src/packages.mak" "${distdir}/extras/contrib/src/packages.mak"
713 if test ! -d "${distdir}/extras/contrib/src/Patches"
715 mkdir "${distdir}/extras/contrib/src/Patches"
717 cp ${srcdir}/extras/contrib/src/Patches/* "${distdir}/extras/contrib/src/Patches/"