3 ## bootstrap.sh file for vlc, the VideoLAN Client
4 ## $Id: bootstrap,v 1.2 2002/08/26 01:01:13 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"
32 rm -f aclocal.m4 configure config.guess config.log config.sub ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh configure.in~ Makefile.am~
36 gettextize --force --intl --copy --no-changelog
37 test -f configure.in~ && mv configure.in~ configure.in
38 test -f Makefile.am~ && mv Makefile.am~ Makefile.am
39 automake --foreign --add-missing --copy
43 # nuahahahahaha !! overwriting Makefile.in with what *I* want!
44 cp Makefile.old Makefile.in
47 ## headers which need to be regenerated because of the VLC_EXPORT macro
49 file=src/misc/modules_plugin.h
50 echo -n " + creating headers: "
52 sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
53 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
54 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
55 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $file
59 file=include/vlc_symbols.h
60 rm -f $file && touch $file
61 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
63 echo 'struct module_symbols_t' >> $file
65 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
66 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' | sort >> $file
69 echo '#ifdef __PLUGIN__' >> $file
70 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
71 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' | sort >> $file
72 echo '#endif /* __PLUGIN__ */' >> $file
78 ## Glade sometimes sucks
80 echo -n " + fixing glade bugs: "
81 for file in gnome_interface.c gtk_interface.c
83 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
85 rm -f /tmp/$$.$file.bak
86 cat > /tmp/$$.$file.bak << EOF
87 /* This file was created automatically by glade and fixed by bootstrap.sh */
91 tail +8 modules/gui/gtk/$file \
92 | sed 's#_("-:--:--")#"-:--:--"#' \
93 | sed 's#_("---")#"---"#' \
94 | sed 's#_("--")#"--"#' \
95 | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
96 | sed 's#_(\("./."\))#\1#' \
98 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
104 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
106 rm -f /tmp/$$.$file.bak
107 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
108 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
114 ## Update the potfiles because no one ever does it
116 if test "$do_po" = "no"
118 echo "not updating potfiles. use --update-po to force doing it."
120 echo -n " + updating potfiles: "
122 make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'