3 ## bootstrap file for the VLC media player
5 ## Copyright (C) 2005-2006 the VideoLAN team
7 ## Authors: Sam Hocevar <sam@zoy.org>
8 ## RĂ©mi Denis-Courmont <rem # videolan # org>
10 if test "$#" != "0"; then
12 echo " Calls automake, autoconf, autoheader, autopoint and other auto* to generate"
13 echo " m4 macros and prepare Makefiles."
18 ### Get a sane environment, just in case
29 ## Check for various tools
32 ACLOCAL_ARGS
="-I m4 ${ACLOCAL_ARGS}"
34 # Check for contrib directory
35 if test -d extras
/contrib
/bin
; then
36 export PATH
="`pwd`/extras/contrib/bin:$PATH"
37 if test -d extras
/contrib
/share
/aclocal
; then
38 ACLOCAL_ARGS
="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
40 if test ".`uname -s`" = ".Darwin"; then
41 export LD_LIBRARY_PATH
=.
/extras
/contrib
/lib
:$LD_LIBRARY_PATH
42 export DYLD_LIBRARY_PATH
=.
/extras
/contrib
/lib
:$DYLD_LIBRARY_PATH
43 elif test ".`uname -s`" = ".BeOS"; then
44 export LIBRARY_PATH
=.
/extras
/contrib
/lib
:$LIBRARY_PATH
45 export BELIBRARIES
=.
/extras
/contrib
/lib
:$BELIBRARIES
47 elif test ".`uname -s`" = ".Darwin"; then
50 echo "ERR: Contribs haven't been built"
51 echo "ERR: Please run:"
53 echo "ERR: 'cd extras/contrib && ./bootstrap && make && cd ../..'"
55 echo "ERR: Make sure fink has been disabled too."
62 rm -f m
4/autoconf260.
m4
63 case "$(autoconf --version|head -n 1)" in
65 echo "$0: you need autoconf version 2.59 or later (2.60 recommanded)."
70 echo "Enabling provisional autoconf 2.59 work-around. Update autoconf ASAP."
71 echo "Press Enter to continue"
73 cp -f extras
/m
4/autoconf260.
m4 m
4/
79 for v
in "-1.10" "110" "-1.9" "19"; do
80 if automake
${v} --version >/dev
/null
2>&1; then
82 amvers
="`echo ${v} | sed -e 's/^-//'`"
87 if test "${amvers}" = "no" && automake
--version > /dev
/null
2>&1; then
88 amvers
="`automake --version | sed -e '1s/[^0-9]*//' -e q`"
93 no|
1.
[012345678]|
1.
[0123456].
*|
1[0123456]|
1.
[0123456]-*)
95 echo "$0: you need automake version 1.9 or later"
102 if test -x extras
/contrib
/bin
/libtoolize
; then
103 libtoolize
="extras/contrib/bin/libtoolize"
104 elif glibtoolize
--version >/dev
/null
2>&1; then
105 libtoolize
="glibtoolize"
106 elif libtoolize
--version >/dev
/null
2>&1; then
107 libtoolize
="libtoolize"
110 if test "$libtoolize" = "no"; then
112 echo "$0: you need libtool"
117 if gettextize
--version >/dev
/null
2>&1; then
118 # Autopoint is available from 0.11.3, but we need 0.11.5
119 if expr `gettextize --version |cut -d' ' -f2- | sed -e '1s/[^0-9]*//' -e q` \
120 '>=' 0.11.5 >/dev
/null
2>&1; then
121 # We have gettext, and a recent version! Everything is cool.
125 # User's gettext is too old. try to continue anyway.
130 echo "$0: you need gettextize (package gettext-devel or gettext)"
134 # Check for pkg-config
135 if pkg-config
--version >/dev
/null
2>&1; then
136 # We have pkg-config, everything is cool.
142 aclocal
=aclocal
${amsuff}
143 automake
=automake
${amsuff}
145 autoheader
=autoheader
148 ## Generate the modules makefile, by parsing modules/**/Modules.am
152 echo "generating modules/**/Makefile.am and m4/private.m4"
154 # Prepare m4/private.m4
155 rm -f m
4/private.
m4 && cat > m
4/private.
m4 << EOF
156 dnl Private VLC macros - generated by bootstrap
160 if [ "${PKGCONFIG}" = "no" ]; then cat >> m
4/private.
m4 << EOF
161 dnl User does not have pkg-config, so assume package was not found
162 AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
167 if [ "${GETTEXT}" != "yes" ]; then cat >> m
4/private.
m4 << EOF
168 dnl User does not have gettext, so this is a no-op
169 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
174 cat >> m
4/private.
m4 << EOF
175 dnl Helper macro for vlc-config generation
176 AC_DEFUN([VLC_CONFIG_HELPER], [
177 cat >> vlc-config.in << BLAH
182 rm -f modules
/Makefile.am
&& cat > modules
/Makefile.am
<< EOF
183 # Autogenerated by bootstrap - DO NOT EDIT
185 dist_noinst_SCRIPTS = genmf
186 SUBDIRS = `sed -ne 's,modules/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`
190 modules
/genmf
`sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
192 cat >> m
4/private.
m4 << EOF
198 ### classic bootstrap stuff
202 # remove autotools cruft
203 rm -f aclocal.
m4 configure config.log config.h config.h.
in
204 rm -Rf autom4te
*.cache
205 # remove old autotools extra cruft
206 rm -f config.guess config.sub missing mkinstalldirs depcomp install-sh
207 # remove new autotools extra cruft
210 # remove libtool cruft
211 rm -f ltmain.sh libtool ltconfig
212 # remove gettext cruft
216 rm -f stamp-builtin stamp-h
* mozilla
/stamp-pic
218 # Automake complains if these are not present
219 rm -f vlc-config.
in && printf "" > vlc-config.
in
220 if [ "$GETTEXT" != "yes" ]; then
221 test -d intl || mkdir intl
222 printf "" > intl
/Makefile.am
223 printf "" > ABOUT-NLS
226 # Libtoolize directory
227 ${libtoolize} --copy --force
228 if test -f "ltmain.sh"; then
229 echo "$0: working around a minor libtool issue"
230 mv ltmain.sh autotools
/
239 rm -f po
/Makevars.template
240 ${aclocal} ${ACLOCAL_ARGS}
243 ${automake} --add-missing --copy -Wall
246 ## files which need to be regenerated
248 rm -f vlc-config.
in vlc-config
249 rm -f src
/misc
/modules_builtin.h
255 ## Tell the user about gettext, pkg-config and sed
257 if [ "${GETTEXT}" = "old" ]; then
260 ==========================================================
261 NOTE: you have an old version of gettext installed on your
262 system. The vlc build will work, but if your system does not
263 have libintl you will not have internationalization support.
264 We suggest upgrading to gettext 0.11.5 or later.
268 if [ "$PKGCONFIG" = "no" ]; then
271 ==============================================================
272 NOTE: you do not have the "pkg-config" utility on your system;
273 detection of the Gtk-2.0 and GNOME 2.0 libraries will not be
278 echo "Successfully bootstrapped"