#! /bin/sh
## bootstrap file for vlc, the VideoLAN Client
-## $Id: bootstrap,v 1.24 2002/11/09 16:34:52 sam Exp $
+## $Id: bootstrap,v 1.25 2002/11/10 18:04:22 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
### argument check
###
do_po=no
+do_msvc=no
while test $# -gt 0; do
case "$1" in
+ --update-msvc)
+ do_msvc=yes
+ ;;
--update-po)
do_po=yes
;;
*)
- echo "unknown option $1"
+ echo "$0: unknown option $1"
+ echo "recognized flags are --update-msvc and --update-po"
+ exit 1
;;
esac
shift
done
+##
+## Update the MSVC project files
+##
+if test "$do_msvc" = "no"
+then
+ echo "not updating MSVC project file. use --update-msvc to force doing it."
+else
+ if test ! -f Makefile
+ then
+ echo "no Makefile found, did you run ./configure?"
+ exit 1
+ fi
+
+ # The evil ^M
+ M='\r'
+
+ # Sources that get built under Win32
+ VLC_SOURCES=`make show-vlc-sources | grep '^X: ' | cut -b3-`
+ LIBVLC_SOURCES=`make show-libvlc-sources | grep '^X: ' | cut -b3-`
+ LIBVLC_HEADERS=`make show-libvlc-headers | grep '^X: ' | cut -b3-`
+ LIBVLC_PKG_HEADERS=`make show-libvlc-pkg-headers | grep '^X: ' | cut -b3-`
+
+ for target in msvc/vlc.vcp msvc/vlc.dsp
+ do
+ rm -f ${target}
+ # Top of the project file
+ cat ${target}.in > ${target}
+ # The source files
+ cat >> ${target} << EOF
+# Begin Group "Source Files"${M}
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"${M}
+# Begin Group "vlc"${M}
+EOF
+ for file in ${VLC_SOURCES}
+ do
+ cat >> ${target} << EOF
+# Begin Source File${M}
+SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
+# End Source File${M}
+EOF
+ done
+ cat >> ${target} << EOF
+# End Group${M}
+# Begin Group "libvlc"${M}
+EOF
+ for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep -v "/.*/"`
+ do
+ cat >> ${target} << EOF
+# Begin Source File${M}
+SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
+# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\"plugins\\" /D DATA_PATH=\\"share\\"${M}
+# End Source File${M}
+EOF
+ done
+ for subdir in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/.*/" | cut -f2 -d/ | sort | uniq`
+ do
+ cat >> ${target} << EOF
+# Begin Group "${subdir}"${M}
+EOF
+ for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/${subdir}/"`
+ do
+ if test "${target}" = "msvc/vlc.vcp"
+ then
+ cat >> ${target} << EOF
+# Begin Source File${M}
+SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
+# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\"plugins\\" /D DATA_PATH=\\"share\\"${M}
+!IF "\$(CFG)" == "vlc - Win32 (WCE MIPS) Release"${M}
+# PROP Intermediate_Dir "Release\\${subdir}"${M}
+# PROP Output_Dir "Release\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 (WCE MIPS) Debug"${M}
+# PROP Intermediate_Dir "Debug\\${subdir}"${M}
+# PROP Output_Dir "Debug\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 (WCE SH4) Release"${M}
+# PROP Intermediate_Dir "Release\\${subdir}"${M}
+# PROP Output_Dir "Release\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 (WCE SH4) Debug"${M}
+# PROP Intermediate_Dir "Debug\\${subdir}"${M}
+# PROP Output_Dir "Debug\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 (WCE SH3) Release"${M}
+# PROP Intermediate_Dir "Release\\${subdir}"${M}
+# PROP Output_Dir "Release\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 (WCE SH3) Debug"${M}
+# PROP Intermediate_Dir "Debug\\${subdir}"${M}
+# PROP Output_Dir "Debug\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 (WCE ARM) Release"${M}
+# PROP Intermediate_Dir "Release\\${subdir}"${M}
+# PROP Output_Dir "Release\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 (WCE ARM) Debug"${M}
+# PROP Intermediate_Dir "Debug\\${subdir}"${M}
+# PROP Output_Dir "Debug\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 (WCE x86em) Release"${M}
+# PROP Intermediate_Dir "Release\\${subdir}"${M}
+# PROP Output_Dir "Release\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 (WCE x86em) Debug"${M}
+# PROP Intermediate_Dir "Debug\\${subdir}"${M}
+# PROP Output_Dir "Debug\\${subdir}"${M}
+!ENDIF${M}
+# End Source File${M}
+EOF
+ else
+ cat >> ${target} << EOF
+# Begin Source File${M}
+SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
+# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\"plugins\\" /D DATA_PATH=\\"share\\"${M}
+!IF "\$(CFG)" == "vlc - Win32 Release"${M}
+# PROP Intermediate_Dir "Release\\${subdir}"${M}
+# PROP Output_Dir "Release\\${subdir}"${M}
+!ELSEIF "\$(CFG)" == "vlc - Win32 Debug"${M}
+# PROP Intermediate_Dir "Debug\\${subdir}"${M}
+# PROP Output_Dir "Debug\\${subdir}"${M}
+!ENDIF${M}
+# End Source File${M}
+EOF
+ fi
+ done
+ cat >> ${target} << EOF
+# End Group${M}
+EOF
+ done
+ cat >> ${target} << EOF
+# End Group${M}
+# End Group${M}
+EOF
+ # The modules
+ echo 'no modules yet'
+ # The headers
+ cat >> ${target} << EOF
+# Begin Group "Header Files"${M}
+# PROP Default_Filter "h;hpp;hxx;hm;inl"${M}
+EOF
+ for file in ${LIBVLC_HEADERS}
+ do
+ cat >> ${target} << EOF
+# Begin Source File${M}
+SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
+# End Source File${M}
+EOF
+ done
+ cat >> ${target} << EOF
+# Begin Group "vlc"${M}
+EOF
+ for file in ${LIBVLC_PKG_HEADERS}
+ do
+ cat >> ${target} << EOF
+# Begin Source File${M}
+SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
+# End Source File${M}
+EOF
+ done
+ cat >> ${target} << EOF
+# End Group${M}
+# End Group${M}
+EOF
+ # Bottom of the project file - handles resource files too
+ cat ${target}.out >> ${target}
+ done
+
+ exit 0
+fi
+
+##
+## Update the potfiles because no one ever does it
+##
+if test "$do_po" = "no"
+then
+ echo "not updating potfiles. use --update-po to force doing it."
+else
+ cd po
+ make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
+ cd ..
+
+ exit 0
+fi
+
##
## Check that our tools don't suck
##
-e 's#_("--")#"--"#' \
-e 's#_("/dev/dvd")#"/dev/dvd"#' \
-e 's#_(\("./."\))#\1#' \
- < modules/gui/gtk/$file >> /tmp/$$.$file.bak
+ < modules/gui/gtk/$file >> /tmp/$$.$file.bak
mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
fi
done
mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
fi
-##
-## Don't update the MSVC project file
-##
-echo "not updating MSVC project file. run 'make update-vlc.dsp' for this."
-
-##
-## Update the potfiles because no one ever does it
-##
-if test "$do_po" = "no"
-then
- echo "not updating potfiles. use --update-po to force doing it."
-else
- cd po
- make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
- cd ..
-fi
-
##
## Tell the user about gettext and sed
##