3 ## bootstrap.sh file for vlc, the VideoLAN Client
4 ## $Id: bootstrap,v 1.3 2002/08/26 09:38:20 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~ ChangeLog~ po/ChangeLog~
37 # run gettextize and then fix its cruft
38 gettextize --force --intl --copy --no-changelog || gettextize --force --copy
39 test -f configure.in~ && mv configure.in~ configure.in
40 test -f Makefile.am~ && mv Makefile.am~ Makefile.am
41 test -f ChangeLog~ && mv ChangeLog~ ChangeLog
42 test -f po/ChangeLog~ && mv po/ChangeLog~ po/ChangeLog
44 automake --foreign --add-missing --copy
48 # nuahahahahaha !! overwriting Makefile.in with what *I* want!
49 cp Makefile.old Makefile.in
52 ## headers which need to be regenerated because of the VLC_EXPORT macro
54 file=src/misc/modules_plugin.h
55 echo -n " + creating headers: "
57 sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
58 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
59 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
60 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $file
64 file=include/vlc_symbols.h
65 rm -f $file && touch $file
66 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
68 echo 'struct module_symbols_t' >> $file
70 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
71 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' | sort >> $file
74 echo '#ifdef __PLUGIN__' >> $file
75 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
76 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' | sort >> $file
77 echo '#endif /* __PLUGIN__ */' >> $file
83 ## Glade sometimes sucks
85 echo -n " + fixing glade bugs: "
86 for file in gnome_interface.c gtk_interface.c
88 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
90 rm -f /tmp/$$.$file.bak
91 cat > /tmp/$$.$file.bak << EOF
92 /* This file was created automatically by glade and fixed by bootstrap.sh */
96 tail +8 modules/gui/gtk/$file \
97 | sed 's#_("-:--:--")#"-:--:--"#' \
98 | sed 's#_("---")#"---"#' \
99 | sed 's#_("--")#"--"#' \
100 | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
101 | sed 's#_(\("./."\))#\1#' \
103 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
109 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
111 rm -f /tmp/$$.$file.bak
112 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
113 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
119 ## Update the potfiles because no one ever does it
121 if test "$do_po" = "no"
123 echo "not updating potfiles. use --update-po to force doing it."
125 echo -n " + updating potfiles: "
127 make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'