]> git.sesse.net Git - vlc/blob - bootstrap
Correct debug message
[vlc] / bootstrap
1 #! /bin/sh
2
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>
9
10 set -e
11
12 cd "$(dirname "$0")"
13
14 if test "$#" != "0"; then
15   echo "Usage: $0"
16   echo "  Calls autoreconf to generate m4 macros and prepare Makefiles."
17   exit 1
18 fi
19
20 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
21
22 ###
23 ###  Get a sane environment, just in case
24 ###
25 CYGWIN=binmode
26 export CYGWIN
27
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"
33   fi
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
39   fi
40 fi
41
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
46 fi
47
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
52
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 ==============================================================
64
65 EOF
66 fi
67
68 ###
69 ### Generate the modules makefile, by parsing modules/**/Modules.am
70 ###
71
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"
80
81 set -x
82
83 ###
84 ###  classic bootstrap stuff
85 ###
86
87 # Automake complains if these are not present
88 echo > ABOUT-NLS
89 cp -f INSTALL INSTALL.git
90
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
95
96 ##
97 ##  files which need to be regenerated
98 ##
99 rm -f stamp-h*
100
101 # Shut up
102 set +x
103 echo "Successfully bootstrapped"