3 ## bootstrap.sh file for vlc, the VideoLAN Client
4 ## $Id: bootstrap,v 1.13 2002/08/29 23:53:22 massiot Exp $
6 ## Authors: Samuel Hocevar <sam@zoy.org>
9 ### get a sane environment
18 while test $# -gt 0; do
24 echo "unknown option $1"
34 rm -f aclocal.m4 configure config.guess config.log config.sub ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh
37 if gettextize --version >/dev/null 2>&1
39 if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
40 '>' 0.11.3 >/dev/null 2>&1
42 # We have gettext, and a recent version! Everything is cool.
46 # What?! User is not using a recent version of gettext? We'll have to
49 gettextize --copy --force | grep '^from the' | cut -f3 -d' '
51 test -f po/ChangeLog~ && mv po/ChangeLog~ po/ChangeLog
53 echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/oldgettext.m4
56 # we don't have gettext. grmbl. try to continue anyway.
58 echo > intl/Makefile.am
59 echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/oldgettext.m4
65 if automake-1.6 --version >/dev/null 2>&1
69 if automake-1.5 --version >/dev/null 2>&1
73 if automake --version > /dev/null 2>&1
75 amvers=`automake --version | head -1 | cut -d\ -f 4`
77 if expr "$amvers" "<" "1.5" > /dev/null 2>&1
85 if test x$amvers = xnone
88 echo "you need automake version 1.5 or later"
93 aclocal${amvers} -I m4
95 automake${amvers} --foreign --add-missing --copy
98 # nuahahahahaha !! overwriting Makefile.in with what *I* want!
99 cp Makefile.old Makefile.in
102 ## headers which need to be regenerated because of the VLC_EXPORT macro
104 file=src/misc/modules_plugin.h
106 sed -e 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
107 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
108 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
109 sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $file
112 file=include/vlc_symbols.h
113 rm -f $file && touch $file
114 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
116 echo 'struct module_symbols_t' >> $file
118 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
119 sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' | sort >> $file
122 echo '#ifdef __PLUGIN__' >> $file
123 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
124 sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' | sort >> $file
125 echo '#endif /* __PLUGIN__ */' >> $file
130 ## Glade sometimes sucks
132 for file in gnome_interface.c gtk_interface.c
134 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
136 rm -f /tmp/$$.$file.bak
137 cat > /tmp/$$.$file.bak << EOF
138 /* This file was created automatically by glade and fixed by bootstrap.sh */
143 -e 's#_("-:--:--")#"-:--:--"#' \
144 -e 's#_("---")#"---"#' \
145 -e 's#_("--")#"--"#' \
146 -e 's#_("/dev/dvd")#"/dev/dvd"#' \
147 -e 's#_(\("./."\))#\1#' \
148 < modules/gui/gtk/$file >> /tmp/$$.$file.bak
149 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
154 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
156 rm -f /tmp/$$.$file.bak
157 sed -e '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
158 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
167 ## Update the potfiles because no one ever does it
169 if test "$do_po" = "no"
171 echo "not updating potfiles. use --update-po to force doing it."
174 make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
179 ## Tell the user about gettext
186 echo "==========================================================="
187 echo "IMPORTANT NOTE: you do not have gettext installed on your"
188 echo "system. The vlc build will work, but you will not have"
189 echo "internationalization support. We suggest installing gettext."
193 echo "=========================================================="
194 echo "NOTE: you have an old version of gettext installed on your"
195 echo "system. We suggest upgrading to gettext 0.11.3 or later."