bootstrap 3.08 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
cd "$(dirname "$0")"

27
##
28
## Check for various tools
29
##
30

31
ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
32

33
# Check for contrib directory
34 35 36 37
if test -d extras/contrib/build/bin; then
  PATH="`pwd`/extras/contrib/build/bin:$PATH"
  if test -d extras/contrib/build/share/aclocal; then
    ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/build/share/aclocal"
38
  fi
39
  if test ".`uname -s`" = ".Darwin"; then
40 41
    LD_LIBRARY_PATH=./extras/contrib/build/lib:$LD_LIBRARY_PATH
    DYLD_LIBRARY_PATH=./extras/contrib/build/lib:$DYLD_LIBRARY_PATH
42 43
    export LD_LIBRARY_PATH
    export DYLD_LIBRARY_PATH
44
  fi
45
elif test ".`uname -s`" = ".Darwin"; then
46 47 48 49 50 51 52 53 54 55 56
  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
57 58
fi

59 60 61 62 63 64 65 66
# 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

67 68 69 70 71 72 73
# Check for autopoint (GNU gettext)
export AUTOPOINT
test "$AUTOPOINT" || AUTOPOINT=autopoint
if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
  AUTOPOINT=true
fi

74 75 76 77
##
## Generate the modules makefile, by parsing modules/**/Modules.am
##

78
set +x
79
echo "generating modules/**/Makefile.am"
80

Sam Hocevar's avatar
Sam Hocevar committed
81
# Prepare m4/private.m4
Sam Hocevar's avatar
Sam Hocevar committed
82
rm -f m4/private.m4 && cat > m4/private.m4 << EOF
83
dnl  Private VLC macros - generated by bootstrap
84 85

EOF
86 87

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

EOF
fi

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

96
###
97
###  classic bootstrap stuff
98
###
99
set -x
100

101
# Automake complains if these are not present
102
echo > ABOUT-NLS
103
cp -f INSTALL INSTALL.git
Sam Hocevar's avatar
Sam Hocevar committed
104

105 106 107
autoreconf --install --force --verbose ${ACLOCAL_ARGS}
rm -f po/Makevars.template ABOUT-NLS
echo > ABOUT-NLS
108
mv -f INSTALL.git INSTALL
109 110

##
Sam Hocevar's avatar
Sam Hocevar committed
111
##  files which need to be regenerated
112
##
113
rm -f stamp-h*
114

115
# Shut up
116
set +x
117

118
##
119
##  Tell the user about gettext, pkg-config and sed
120
##
121 122 123 124 125 126
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
127
Also check if you have cvs, a dependency of autopoint.
128 129 130 131
Otherwise, you will not be able to build a source tarball.
EOF
fi

132
if [ "$PKGCONFIG" = "no" ]; then
133
  cat << EOF
134 135

==============================================================
136 137
NOTE: "pkg-config" is missing from your system. Certain
libraries may not be detected properly.
138
EOF
139
fi
140

141
echo "Successfully bootstrapped"