3 ## bootstrap.sh file for vlc, the VideoLAN Client
4 ## $Id: bootstrap,v 1.10 2002/08/28 14:22:17 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
36 if gettextize --version >/dev/null 2>&1
38 if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
39 '>' 0.11.3 >/dev/null 2>&1
41 # We have gettext, and a recent version! Everything is cool.
44 echo 'EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4 progtest.m4' > m4/Makefile.am
47 # What?! User is not using a recent version of gettext? We'll have to
50 aclocaldir=`gettextize --copy --force | grep '^from the' | cut -f3 -d' '`
52 test -f po/ChangeLog~ && mv po/ChangeLog~ po/ChangeLog
54 # Yuck! - don't copy anything, it makes old autoconf barf.
55 #for file in codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 \
56 # lcmessage.m4 progtest.m4
57 # do cp ${aclocaldir}/${file} m4/
60 echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/gettext.m4
63 # we don't have gettext. grmbl. try to continue anyway.
65 echo > intl/Makefile.am
68 echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/gettext.m4
69 echo 'AC_DEFUN([AM_GNU_GETTEXT], [])' >> m4/gettext.m4
74 if automake-1.6 --version >/dev/null 2>&1
77 else if automake-1.5 --version >/dev/null 2>&1
82 echo "you need automake version 1.5 or later"
86 aclocal-${amvers} -I m4
88 automake-${amvers} --foreign --add-missing --copy
91 # nuahahahahaha !! overwriting Makefile.in with what *I* want!
92 cp Makefile.old Makefile.in
95 ## headers which need to be regenerated because of the VLC_EXPORT macro
97 file=src/misc/modules_plugin.h
99 sed -e 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
100 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
101 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
102 sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $file
105 file=include/vlc_symbols.h
106 rm -f $file && touch $file
107 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
109 echo 'struct module_symbols_t' >> $file
111 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
112 sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' | sort >> $file
115 echo '#ifdef __PLUGIN__' >> $file
116 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
117 sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' | sort >> $file
118 echo '#endif /* __PLUGIN__ */' >> $file
123 ## Glade sometimes sucks
125 for file in gnome_interface.c gtk_interface.c
127 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
129 rm -f /tmp/$$.$file.bak
130 cat > /tmp/$$.$file.bak << EOF
131 /* This file was created automatically by glade and fixed by bootstrap.sh */
136 -e 's#_("-:--:--")#"-:--:--"#' \
137 -e 's#_("---")#"---"#' \
138 -e 's#_("--")#"--"#' \
139 -e 's#_("/dev/dvd")#"/dev/dvd"#' \
140 -e 's#_(\("./."\))#\1#' \
141 < modules/gui/gtk/$file >> /tmp/$$.$file.bak
142 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
147 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
149 rm -f /tmp/$$.$file.bak
150 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
151 mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
160 ## Update the potfiles because no one ever does it
162 if test "$do_po" = "no"
164 echo "not updating potfiles. use --update-po to force doing it."
167 make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
172 ## Tell the user about gettext
179 echo "==========================================================="
180 echo "IMPORTANT NOTE: you do not have gettext installed on your"
181 echo "system. The vlc build will work, but you will not have"
182 echo "internationalization support. We suggest installing gettext."
186 echo "=========================================================="
187 echo "NOTE: you have an old version of gettext installed on your"
188 echo "system. We suggest upgrading to gettext 0.11.3 or later."