3 ## bootstrap.sh file for vlc, the VideoLAN Client
4 ## $Id: bootstrap,v 1.4 2002/08/26 20:49:49 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"
33 rm -f aclocal.m4 configure config.guess config.log config.sub ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh
35 if expr `gettextize --version | head -1 | sed 's/[^0-9]*//'` \
36 '>' 0.11.3 >/dev/null 2>&1
40 # What?! User is not using a recent version of gettext? We'll have to
43 aclocaldir=`gettextize --copy --force | grep '^from the' | cut -f3 -d' '`
45 test -f po/ChangeLog~ && mv po/ChangeLog~ po/ChangeLog
48 for file in codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 \
49 lcmessage.m4 progtest.m4
50 do cp ${aclocaldir}/${file} m4/
53 echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' >> m4/gettext.m4
57 automake --foreign --add-missing --copy
61 # nuahahahahaha !! overwriting Makefile.in with what *I* want!
62 cp Makefile.old Makefile.in
65 ## headers which need to be regenerated because of the VLC_EXPORT macro
67 file=src/misc/modules_plugin.h
69 sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
70 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
71 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
72 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $file
75 file=include/vlc_symbols.h
76 rm -f $file && touch $file
77 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
79 echo 'struct module_symbols_t' >> $file
81 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
82 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' | sort >> $file
85 echo '#ifdef __PLUGIN__' >> $file
86 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
87 sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' | sort >> $file
88 echo '#endif /* __PLUGIN__ */' >> $file
93 ## Glade sometimes sucks
95 for file in gnome_interface.c gtk_interface.c
97 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
99 rm -f /tmp/$$.$file.bak
100 cat > /tmp/$$.$file.bak << EOF
101 /* This file was created automatically by glade and fixed by bootstrap.sh */
105 tail +8 modules/gui/gtk/$file \
106 | sed 's#_("-:--:--")#"-:--:--"#' \
107 | sed 's#_("---")#"---"#' \
108 | sed 's#_("--")#"--"#' \
109 | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
110 | sed 's#_(\("./."\))#\1#' \
112 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
117 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
119 rm -f /tmp/$$.$file.bak
120 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
121 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
126 ## Update the potfiles because no one ever does it
128 if test "$do_po" = "no"
130 echo "not updating potfiles. use --update-po to force doing it."
133 make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'