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-po update translation files
30 --update-includes generate various include files
31 --update-glade2 generate and fix Glade 2 code
32 --update-flexml generate and fix flexml and flex code
33 --distclean "make distclean" on steroids
34 --dist-contrib add the contrib dir to MAKE_DIST
40 ## Extract stuff from Makefile.am
44 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" | \
46 sed -ne 's/[^-$()_a-zA-Z0-9][^-$()_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p' | \
47 sed -e "s,^,${srcdir}/,"
60 --changelog|
--update-changelog)
72 --update-glade2|
--update-glade-2|
--fix-glade2)
88 echo "$0: unknown option $1"
95 ## Add includes to help doxygen
97 if test "${action}" = "include"
100 */vlc_common.h|
*/include
/vlc
/*);;
101 */include
/*.h
) echo "#include <vlc_common.h>" ;;
108 ## Update the CVS changelog
110 if test "${action}" = "changelog"
113 echo "toolbox --changelog no longer required. use this instead:"
114 echo " LANG=C svn log -v -r '{$YEAR-12-31}:{$YEAR-01-01}' > ChangeLog"
119 ## Update the potfiles because no one ever does it
121 if test "${action}" = "po"
123 # find out the source files
124 echo "WARNING: you should run \"make update-po\" instead!" >&2
130 ## Create include files
132 if test "${action}" = "includes"
136 if test -z "${srcdir}"; then
137 srcdir
="`sed -ne 's/^srcdir *= *//p' < Makefile`"
139 if test -z "${builddir}"; then
140 builddir
="`sed -ne 's/^top_builddir *= *//p' < Makefile`"
142 BUILTINS
=`sed -ne 's/.*builtins *= *" *\([^"]*\)".*/\1/p' ${builddir}/vlc-config`
144 file="${builddir}/src/modules/builtin.h"
147 mkdir
-p -- "${builddir}/src/modules"
148 cat "${srcdir}/src/modules/builtin.h.in" > "${file}.tmp" ||
exit 1
149 if test -n "${BUILTINS}"
151 for i
in `echo ${BUILTINS}`
153 echo "int vlc_entry__`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`( module_t* );" >> "${file}.tmp"
155 echo "" >> "${file}.tmp"
157 echo "#define ALLOCATE_ALL_BUILTINS() \\" >> ${file}.tmp
158 echo " do \\" >> "${file}.tmp"
159 echo " { \\" >> "${file}.tmp"
160 if test -n "${BUILTINS}"
162 for i
in `echo ${BUILTINS}`
164 echo " ALLOCATE_BUILTIN(`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`); \\" >> "${file}.tmp"
167 echo " } while( 0 );" >> "${file}.tmp"
168 echo "" >> "${file}.tmp" ||
exit 1
169 if diff >/dev
/null
2>&1 "${file}" "${file}.tmp"
173 echo "creating new ${file}"
174 mv -f "${file}.tmp" "${file}"
181 ## Fix glade2-generated files
183 if test "${action}" = "glade2"
185 file="modules/gui/pda/pda.glade"
186 echo "generating code from $file"
187 glade-2
-w "$file" ||
exit 1
189 file="modules/gui/pda/pda_interface.c"
191 if grep "DO NOT EDIT THIS FILE" "$file" >/dev
/null
2>&1
193 rm -f -- "$file.$$.bak"
194 cat > "$file.$$.bak" << EOF
195 /* This file was created automatically by glade2 and fixed by bootstrap */
200 -e 's#_(\(".:..:.."\))#\1#' \
201 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
202 -e 's#_("---")#"---"#' \
203 -e 's#_("--")#"--"#' \
204 -e 's#_(\("/dev/[^"]*"\))#\1#' \
205 -e 's#_(\("./."\))#\1#' \
206 < "$file" >> "$file.$$.bak"
207 mv -f "$file.$$.bak" "$file"
216 if test "${action}" = "distclean"
219 # a naive sanity check to make sure we are in a VLC tree
220 test -f vlc.mandriva.spec
-a -f vlc.win32.nsi.
in ||
exit 1
222 find .
-false -path './extras/contrib/*' -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 '{}' ';'
223 (cd autotools
&& find .
-maxdepth 1 -name '[a-z]*' -exec rm -f '{}' ';')
224 find .
-type d
-name '.deps' -exec rm -Rf '{}' ';'
225 find .
-type d
-name '.libs' -exec rm -Rf '{}' ';'
226 # there's some more cruft all around
227 rm -f config.h config.log config.status
228 rm -f vlc vlc-config Makefile Modules.am
229 rm -Rf autom4te.cache
230 echo "\`toolbox --distclean\' is known to be broken."
231 echo "Don't complain if it does not work, or better yet, don't use it."
232 echo "You were warned."
233 # FIXME: a lot of Makefiles are still there
237 ## Add the extras/contrib dir to the distribution
239 if test "${action}" = "contrib"
242 if test ! -d "${distdir}/extras"
244 mkdir
"${distdir}/extras"
246 if test ! -d "${distdir}/extras/contrib"
248 mkdir
"${distdir}/extras/contrib"
250 cp "${srcdir}/extras/contrib/Makefile" "${distdir}/extras/contrib/Makefile"
251 cp "${srcdir}/extras/contrib/README" "${distdir}/extras/contrib/README"
252 cp "${srcdir}/extras/contrib/bootstrap" "${distdir}/extras/contrib/bootstrap"
253 cp "${srcdir}/extras/contrib/change_prefix.sh" "${distdir}/extras/contrib/change_prefix.sh"
254 if test ! -d "${distdir}/extras/contrib/src"
256 mkdir
"${distdir}/extras/contrib/src"
258 cp "${srcdir}/extras/contrib/src/Makefile" "${distdir}/extras/contrib/src/Makefile"
259 cp "${srcdir}/extras/contrib/src/packages.mak" "${distdir}/extras/contrib/src/packages.mak"
260 if test ! -d "${distdir}/extras/contrib/src/Patches"
262 mkdir
"${distdir}/extras/contrib/src/Patches"
264 cp ${srcdir}/extras
/contrib
/src
/Patches
/* "${distdir}/extras/contrib/src/Patches/"