]> git.sesse.net Git - vlc/blobdiff - toolbox
Use Latin-9 rather than US-ASCII when there is no local charset
[vlc] / toolbox
diff --git a/toolbox b/toolbox
index deed580500dbf9e9bb89d392d07fc4c4a77d1aae..5911747227232a1d23c83e89ed9803bedd847dd2 100755 (executable)
--- a/toolbox
+++ b/toolbox
@@ -3,7 +3,10 @@
 ##  toolbox for the VLC media player
 ##  $Id$
 ##
+##  Copyright (C) 2005  the VideoLAN team
+##
 ##  Authors: Samuel Hocevar <sam@zoy.org>
+##           RĂ©mi Denis-Courmont <rem # videolan.org>
 
 ###
 ###  Get a sane environment, just in case
@@ -29,6 +32,7 @@ recognized flags are:
   --update-glade2         generate and fix Glade 2 code
   --update-flexml         generate and fix flexml and flex code
   --distclean             "make distclean" on steroids
+  --dist-contrib          add the contrib dir to MAKE_DIST
   --make-woody <dir>      change distdir <dir> to a woody distdir
 EOF
   exit 1
@@ -85,6 +89,9 @@ case "$1" in
   --add-include)
     action=include
     ;;
+  --dist-contrib)
+    action=contrib
+    ;;
   --help)
     help
     ;;
@@ -131,7 +138,8 @@ then
   fi
 
   #  The evil ^M. printf '\r' does not work in Cygwin.
-  M='\r'
+  M='
+'
 
   #  Variables we get from configure.ac
   LIBVLC_VERSION=`sed -ne '/AC_INIT/s/.*,\(.*\))/\1/p' < configure.ac`
@@ -363,27 +371,9 @@ fi
 if test "${action}" = "po"
 then
   # find out the source files
-  rm -f po/POTFILES.in
-  echo "# automatically created by toolbox --update-po" > po/POTFILES.in
-  echo "" >> po/POTFILES.in
-  echo "# main sources" >> po/POTFILES.in
-  find include src -name '*.[chm]' -o -name '*.[ch]pp' \
-    | grep -v '\(vlc_symbols\|misc/modules_\)' \
-    | sort >> po/POTFILES.in
-  echo "" >> po/POTFILES.in
-  echo "# modules" >> po/POTFILES.in
-  find modules -name '*.[chm]' -o -name '*.[ch]pp' \
-    | grep -v '\(\.moc\.\|gui/gtk2/\)' \
-    | sort >> po/POTFILES.in
-  # clean old potfiles
-  cd po
-  rm -f vlc.pot
-  # update
-  make vlc.pot || exit 1
-  make update-po || exit 1
-  cd ..
-
-  exit 0
+  echo "WARNING: you should run \"make update-po\" instead!" >&2
+  make update-po
+  exit $?
 fi
 
 ##
@@ -396,45 +386,14 @@ then
   if test -z "${srcdir}"; then
     srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
   fi
-  LIBVLC_HEADERS=`getfiles HEADERS_include`
-  BUILTINS=`sed -ne 's/.*builtins *= *" *\([^"]*\)".*/\1/p' vlc-config`
-
-  file="${srcdir}/include/vlc_symbols.h"
-
-  rm -f ${file}.in
-  echo '/* DO NOT EDIT THIS FILE! See Makefile.am */' >> ${file}.in
-  echo 'struct module_symbols_t {' >> ${file}.in
-  cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' >> ${file}.in
-  echo '};' >> ${file}.in
-  echo '#ifdef __PLUGIN__' >> ${file}.in
-  cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' >> ${file}.in
-  echo '#endif /* __PLUGIN__ */' >> ${file}.in
-  if diff >/dev/null 2>&1 ${file} ${file}.in
-  then
-    rm -f ${file}.in
-  else
-    echo "creating new ${file}"
-    mv -f ${file}.in ${file}
-  fi
-
-  file="${srcdir}/src/misc/modules_plugin.h"
-
-  rm -f ${file}.tmp && cp ${file}.in ${file}.tmp
-  sed -e 's#.*\$[I][d]:.*# * Automatically generated from '${file}'.in by bootstrap#' < ${file}.in > ${file}.tmp
-  echo '#define STORE_SYMBOLS( p_symbols ) \' >> ${file}.tmp
-  cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> ${file}.tmp
-  echo '' >> ${file}.tmp
-  if diff >/dev/null 2>&1 ${file} ${file}.tmp
-  then
-    rm -f ${file}.tmp
-  else
-    echo "creating new ${file}"
-    mv -f ${file}.tmp ${file}
+  if test -z "${builddir}"; then
+    builddir="`sed -ne 's/^top_builddir *= *//p' < Makefile`"
   fi
+  BUILTINS=`sed -ne 's/.*builtins *= *" *\([^"]*\)".*/\1/p' vlc-config`
 
-  file="${srcdir}/src/misc/modules_builtin.h"
+  file="${builddir}/src/misc/modules_builtin.h"
 
-  rm -f ${file}.tmp && cp ${file}.in ${file}.tmp
+  rm -f ${file}.tmp && cp ${srcdir}/src/misc/modules_builtin.h.in ${file}.tmp
   if test -n "${BUILTINS}"
   then
     for i in `echo ${BUILTINS}`
@@ -564,12 +523,12 @@ then
   # a naive sanity check to make sure we are in a VLC tree
   test -f vlc.spec.mdk -a -f debian/rules || exit 1
   # let's rock!
-  find . -type f '(' -name '*.[oa]' -o -name '*.so' -o -name '*.sl' -o -name '*.dylib' -o -name '*.dll' -o -name .dirstamp -o -name Makefile.in -o -name 'stamp-h*' -o -name '*~' -o -name '*.bak' -o -name '*.moc.cpp' ')' -exec rm -f '{}' ';'
+  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 '{}' ';'
   (cd autotools && find . -name '[a-z]*' -maxdepth 1 -exec rm -f '{}' ';')
-  (cd debian && find . -type d -name '[a-z]*' -maxdepth 1 -exec rm -Rf '{}' ';')
+  (cd debian && find . -type d '(' -name '[a-z]*' ! -name 'patches' ')' -maxdepth 1 -exec rm -Rf '{}' ';')
   find msvc -type f -name '*.dsp' -exec rm -f '{}' ';'
   find evc -type f -name '*.vcp' -exec rm -f '{}' ';'
-  #find . -type d -name '.deps' -exec rm -Rf '{}' ';'
+  find . -type d -name '.deps' -exec rm -Rf '{}' ';'
   # there's some more cruft all around
   rm -f config.h config.log config.status
   rm -f vlc vlc-config Makefile Modules.am
@@ -578,6 +537,37 @@ then
   # FIXME: a lot of Makefiles are still there
 fi
 
+##
+## Add the extras/contrib dir to the distribution
+##
+if test "${action}" = "contrib"
+then
+  set -x
+  if test ! -d "${distdir}/extras"
+  then
+    mkdir "${distdir}/extras"
+  fi
+  if test ! -d "${distdir}/extras/contrib"
+  then
+    mkdir "${distdir}/extras/contrib"
+  fi
+  cp "${srcdir}/extras/contrib/Makefile" "${distdir}/extras/contrib/Makefile"
+  cp "${srcdir}/extras/contrib/README" "${distdir}/extras/contrib/README"
+  cp "${srcdir}/extras/contrib/bootstrap" "${distdir}/extras/contrib/bootstrap"
+  cp "${srcdir}/extras/contrib/change_prefix.sh" "${distdir}/extras/contrib/change_prefix.sh"
+  if test ! -d "${distdir}/extras/contrib/src"
+  then
+    mkdir "${distdir}/extras/contrib/src"
+  fi
+  cp "${srcdir}/extras/contrib/src/Makefile" "${distdir}/extras/contrib/src/Makefile"
+  cp "${srcdir}/extras/contrib/src/packages.mak" "${distdir}/extras/contrib/src/packages.mak"
+  if test ! -d "${distdir}/extras/contrib/src/Patches"
+  then
+    mkdir "${distdir}/extras/contrib/src/Patches"
+  fi
+  cp ${srcdir}/extras/contrib/src/Patches/* "${distdir}/extras/contrib/src/Patches/"
+fi
+
 ##
 ##  Build a woody-friendly package
 ##