bootstrap 3.34 KB
Newer Older
1 2
#! /bin/sh

3
##  bootstrap file for the VLC media player
4
##
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
5
## Copyright (C) 2005-2008 the VideoLAN team
6
##
7 8
##  Authors: Sam Hocevar <sam@zoy.org>
##           Rémi Denis-Courmont <rem # videolan # org>
9

Sam Hocevar's avatar
Sam Hocevar committed
10 11
if test "$#" != "0"; then
  echo "Usage: $0"
12
  echo "  Calls autoreconf to generate m4 macros and prepare Makefiles."
13 14 15
  exit 1
fi

16
###
17
###  Get a sane environment, just in case
18
###
19 20
CYGWIN=binmode
export CYGWIN
21

22
set -e
23
set -x
24

25
##
26
## Check for various tools
27
##
28

29
ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
30

31
# Check for contrib directory
32
if test -d extras/contrib/bin; then
33
  PATH="`pwd`/extras/contrib/bin:$PATH"
34 35 36
  if test -d extras/contrib/share/aclocal; then
    ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
  fi
37
  if test ".`uname -s`" = ".Darwin"; then
38 39 40 41
    LD_LIBRARY_PATH=./extras/contrib/lib:$LD_LIBRARY_PATH
    DYLD_LIBRARY_PATH=./extras/contrib/lib:$DYLD_LIBRARY_PATH
    export LD_LIBRARY_PATH
    export DYLD_LIBRARY_PATH
42
  elif test ".`uname -s`" = ".BeOS"; then
43 44 45 46
    LIBRARY_PATH=./extras/contrib/lib:$LIBRARY_PATH
    BELIBRARIES=./extras/contrib/lib:$BELIBRARIES
    export LIBRARY_PATH
    export BELIBRARIES
47
  fi
48
elif test ".`uname -s`" = ".Darwin"; then
49 50 51 52 53 54 55 56 57 58 59
  set +x
  echo ""
  echo "ERR: Contribs haven't been built"
  echo "ERR: Please run:"
  echo "ERR: "
  echo "ERR:    'cd extras/contrib && ./bootstrap && make && cd ../..'"
  echo "ERR: "
  echo "ERR: Make sure fink has been disabled too."
  echo ""
  set -x
  exit 1
60 61
fi

62 63 64 65 66 67 68 69
# Check for pkg-config
if pkg-config --version >/dev/null 2>&1; then
  # We have pkg-config, everything is cool.
  PKGCONFIG=yes
else
  PKGCONFIG=no
fi

70 71 72 73 74 75 76 77
# Check for autopoint (GNU gettext)
export AUTOPOINT
test "$AUTOPOINT" || AUTOPOINT=autopoint
if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
  AUTOPOINT=true
  echo > ABOUT-NLS
fi

78 79 80 81
##
## Generate the modules makefile, by parsing modules/**/Modules.am
##

82
set +x
83
echo "generating modules/**/Makefile.am"
84

Sam Hocevar's avatar
Sam Hocevar committed
85
# Prepare m4/private.m4
Sam Hocevar's avatar
Sam Hocevar committed
86
rm -f m4/private.m4 && cat > m4/private.m4 << EOF
87
dnl  Private VLC macros - generated by bootstrap
88 89

EOF
90 91

if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
92 93
dnl  User does not have pkg-config, so assume package was not found
AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
94 95 96 97

EOF
fi

98
modules/genmf `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
99

100
###
101
###  classic bootstrap stuff
102
###
103
set -x
104

105
# Automake complains if these are not present
106
echo > vlc-config.in
107
echo > ABOUT-NLS
108
cp -f INSTALL INSTALL.git
Sam Hocevar's avatar
Sam Hocevar committed
109

110 111 112
autoreconf --install --force --verbose ${ACLOCAL_ARGS}
rm -f po/Makevars.template ABOUT-NLS
echo > ABOUT-NLS
113
mv -f INSTALL.git INSTALL
114 115

##
Sam Hocevar's avatar
Sam Hocevar committed
116
##  files which need to be regenerated
117
##
Sam Hocevar's avatar
Sam Hocevar committed
118
rm -f vlc-config.in vlc-config
119
rm -f src/misc/modules_builtin.h
120
rm -f stamp-builtin stamp-h* mozilla/stamp-pic
121

122
# Shut up
123
set +x
124

125
##
126
##  Tell the user about gettext, pkg-config and sed
127
##
128 129 130 131 132 133
if [ "$AUTOPOINT" = "true" ]; then
  cat << EOF

==============================================================
NOTE: GNU gettext appears to be missing or out-of-date.
Please install or update GNU gettext.
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
134
Also check if you have cvs, a dependency of autopoint.
135 136 137 138
Otherwise, you will not be able to build a source tarball.
EOF
fi

139
if [ "$PKGCONFIG" = "no" ]; then
140
  cat << EOF
141 142

==============================================================
143 144
NOTE: "pkg-config" is missing from your system. Certain
libraries may not be detected properly.
145
EOF
146
fi
147

148
echo "Successfully bootstrapped"