3 ## bootstrap.sh file for vlc, the VideoLAN Client
4 ## $Id: bootstrap,v 1.1 2002/08/25 23:18:04 sam Exp $
6 ## Authors: Samuel Hocevar <sam@zoy.org>
9 ### get a sane environment
17 while test $# -gt 0; do
23 echo "unknown option $1"
34 echo "no" | gettextize --force --intl --copy --no-changelog
35 automake --foreign --add-missing --copy
38 # nuahahahahaha !! overwriting Makefile.in with what *I* want!
39 cp Makefile.old Makefile.in
42 ## headers which need to be regenerated because of the VLC_EXPORT macro
44 file=src/misc/modules_plugin.h
45 echo -n " + creating headers: "
47 sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
48 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
49 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
50 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $file
54 file=include/vlc_symbols.h
55 rm -f $file && touch $file
56 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
58 echo 'struct module_symbols_t' >> $file
60 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
61 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' | sort >> $file
64 echo '#ifdef __PLUGIN__' >> $file
65 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
66 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' | sort >> $file
67 echo '#endif /* __PLUGIN__ */' >> $file
73 ## Glade sometimes sucks
75 echo -n " + fixing glade bugs: "
76 for file in gnome_interface.c gtk_interface.c
78 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
80 rm -f /tmp/$$.$file.bak
81 cat > /tmp/$$.$file.bak << EOF
82 /* This file was created automatically by glade and fixed by bootstrap.sh */
86 tail +8 modules/gui/gtk/$file \
87 | sed 's#_("-:--:--")#"-:--:--"#' \
88 | sed 's#_("---")#"---"#' \
89 | sed 's#_("--")#"--"#' \
90 | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
91 | sed 's#_(\("./."\))#\1#' \
93 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
99 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
101 rm -f /tmp/$$.$file.bak
102 sed 's/DO NOT EDIT THIS FILE.*/This file was created automatically by glade and fixed by bootstrap.sh/ ; s/#if.*ENABLE_NLS.*/#if defined( ENABLE_NLS ) \&\& defined ( HAVE_GETTEXT )/' < modules/gui/gtk/$file > /tmp/$$.$file.bak
103 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
109 ## Update the potfiles because no one ever does it
111 if test "$do_po" = "no"
113 echo "not updating potfiles. use --update-po to force doing it."
115 echo -n " + updating potfiles: "
117 make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'