]> git.sesse.net Git - vlc/blob - bootstrap
Remove unmaintained BeOS support
[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 if test "$#" != "0"; then
11   echo "Usage: $0"
12   echo "  Calls autoreconf to generate m4 macros and prepare Makefiles."
13   exit 1
14 fi
15
16 ###
17 ###  Get a sane environment, just in case
18 ###
19 CYGWIN=binmode
20 export CYGWIN
21
22 set -e
23 set -x
24
25 cd "$(dirname "$0")"
26
27 ##
28 ## Check for various tools
29 ##
30
31 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
32
33 # Check for contrib directory
34 if test -d extras/contrib/build/bin; then
35   PATH="`pwd`/extras/contrib/build/bin:$PATH"
36   if test -d extras/contrib/build/share/aclocal; then
37     ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/build/share/aclocal"
38   fi
39   if test ".`uname -s`" = ".Darwin"; then
40     LD_LIBRARY_PATH=./extras/contrib/build/lib:$LD_LIBRARY_PATH
41     DYLD_LIBRARY_PATH=./extras/contrib/build/lib:$DYLD_LIBRARY_PATH
42     export LD_LIBRARY_PATH
43     export DYLD_LIBRARY_PATH
44   fi
45 elif test ".`uname -s`" = ".Darwin"; then
46   set +x
47   echo ""
48   echo "ERR: Contribs haven't been built"
49   echo "ERR: Please run:"
50   echo "ERR: "
51   echo "ERR:    'cd extras/contrib && ./bootstrap && make && cd ../..'"
52   echo "ERR: "
53   echo "ERR: Make sure fink has been disabled too."
54   echo ""
55   set -x
56   exit 1
57 fi
58
59 # Check for pkg-config
60 if pkg-config --version >/dev/null 2>&1; then
61   # We have pkg-config, everything is cool.
62   PKGCONFIG=yes
63 else
64   PKGCONFIG=no
65 fi
66
67 # Check for autopoint (GNU gettext)
68 export AUTOPOINT
69 test "$AUTOPOINT" || AUTOPOINT=autopoint
70 if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
71   AUTOPOINT=true
72   echo > ABOUT-NLS
73 fi
74
75 ##
76 ## Generate the modules makefile, by parsing modules/**/Modules.am
77 ##
78
79 set +x
80 echo "generating modules/**/Makefile.am"
81
82 # Prepare m4/private.m4
83 rm -f m4/private.m4 && cat > m4/private.m4 << EOF
84 dnl  Private VLC macros - generated by bootstrap
85
86 EOF
87
88 if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
89 dnl  User does not have pkg-config, so assume package was not found
90 AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
91
92 EOF
93 fi
94
95 sh modules/genmf `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
96
97 ###
98 ###  classic bootstrap stuff
99 ###
100 set -x
101
102 # Automake complains if these are not present
103 echo > vlc-config.in
104 echo > ABOUT-NLS
105 cp -f INSTALL INSTALL.git
106
107 autoreconf --install --force --verbose ${ACLOCAL_ARGS}
108 rm -f po/Makevars.template ABOUT-NLS
109 echo > ABOUT-NLS
110 mv -f INSTALL.git INSTALL
111
112 ##
113 ##  files which need to be regenerated
114 ##
115 rm -f vlc-config.in vlc-config
116 rm -f src/misc/modules_builtin.h
117 rm -f stamp-builtin stamp-h* mozilla/stamp-pic
118
119 # Shut up
120 set +x
121
122 ##
123 ##  Tell the user about gettext, pkg-config and sed
124 ##
125 if [ "$AUTOPOINT" = "true" ]; then
126   cat << EOF
127
128 ==============================================================
129 NOTE: GNU gettext appears to be missing or out-of-date.
130 Please install or update GNU gettext.
131 Also check if you have cvs, a dependency of autopoint.
132 Otherwise, you will not be able to build a source tarball.
133 EOF
134 fi
135
136 if [ "$PKGCONFIG" = "no" ]; then
137   cat << EOF
138
139 ==============================================================
140 NOTE: "pkg-config" is missing from your system. Certain
141 libraries may not be detected properly.
142 EOF
143 fi
144
145 echo "Successfully bootstrapped"