Netsync: fix return type
[vlc.git] / bootstrap
blob38f85ff2891ec439d556ef4a5009d7bef09fb8d1
1 #! /bin/sh
3 ## bootstrap file for the VLC media player
4 ##
5 ## Copyright (C) 2005-2008 the VideoLAN team
6 ##
7 ## Authors: Sam Hocevar <sam@zoy.org>
8 ## RĂ©mi Denis-Courmont <rem # videolan # org>
10 set -e
12 cd "$(dirname "$0")"
14 if test "$#" != "0"; then
15 echo "Usage: $0"
16 echo " Calls autoreconf to generate m4 macros and prepare Makefiles."
17 exit 1
20 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
22 ###
23 ### Get a sane environment, just in case
24 ###
25 CYGWIN=binmode
26 export CYGWIN
28 # Check for contrib directory
29 if test -d extras/contrib/build/bin; then
30 PATH="`pwd`/extras/contrib/build/bin:$PATH"
31 if test -d extras/contrib/build/share/aclocal; then
32 ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/build/share/aclocal"
34 if test ".`uname -s`" = ".Darwin"; then
35 LD_LIBRARY_PATH=./extras/contrib/build/lib:$LD_LIBRARY_PATH
36 DYLD_LIBRARY_PATH=./extras/contrib/build/lib:$DYLD_LIBRARY_PATH
37 export LD_LIBRARY_PATH
38 export DYLD_LIBRARY_PATH
42 # Check for pkg-config
43 if ! "${PKG_CONFIG:-pkg-config}" --version >/dev/null 2>&1; then
44 echo 'Error: "pkg-config" is not installed.' >&2
45 exit 1
48 # Prepare m4/private.m4
49 rm -f m4/private.m4 && cat > m4/private.m4 << EOF
50 dnl Private VLC macros - generated by bootstrap
51 EOF
53 # Check for autopoint (GNU gettext)
54 export AUTOPOINT
55 test "$AUTOPOINT" || AUTOPOINT=autopoint
56 if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
57 AUTOPOINT=true
58 cat << EOF
59 NOTE: GNU gettext appears to be missing or out-of-date.
60 Please install or update GNU gettext.
61 Also check if you have cvs, a dependency of autopoint.
62 Otherwise, you will not be able to build a source tarball.
63 ==============================================================
65 EOF
68 ###
69 ### Generate the modules makefile, by parsing modules/**/Modules.am
70 ###
72 echo "generating modules/**/Makefile.am"
73 find modules/ -name Modules.am | \
74 sed -ne 's,modules/\(.*\)/Modules.am,\1,p' | \
75 while read d; do
76 sh modules/genmf "$d"
77 printf "."
78 done
79 printf "\n"
81 set -x
83 ###
84 ### classic bootstrap stuff
85 ###
87 # Automake complains if these are not present
88 echo > ABOUT-NLS
89 cp -f INSTALL INSTALL.git
91 autoreconf --install --force --verbose ${ACLOCAL_ARGS}
92 rm -f po/Makevars.template ABOUT-NLS
93 echo > ABOUT-NLS
94 mv -f INSTALL.git INSTALL
97 ## files which need to be regenerated
99 rm -f stamp-h*
101 # Shut up
102 set +x
103 echo "Successfully bootstrapped"