bootstrap 3.41 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
##
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
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
  elif test ".`uname -s`" = ".BeOS"; then
45 46
    LIBRARY_PATH=./extras/contrib/build/lib:$LIBRARY_PATH
    BELIBRARIES=./extras/contrib/build/lib:$BELIBRARIES
47 48
    export LIBRARY_PATH
    export BELIBRARIES
49
  fi
50
elif test ".`uname -s`" = ".Darwin"; then
51 52 53 54 55 56 57 58 59 60 61
  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
62 63
fi

64 65 66 67 68 69 70 71
# 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

72 73 74 75 76 77 78 79
# 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

80 81 82 83
##
## Generate the modules makefile, by parsing modules/**/Modules.am
##

84
set +x
85
echo "generating modules/**/Makefile.am"
86

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

EOF
Gildas Bazin's avatar
 
Gildas Bazin committed
92 93

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

EOF
fi

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

102
###
103
###  classic bootstrap stuff
104
###
105
set -x
106

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

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

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

124
# Shut up
125
set +x
126

127
##
128
##  Tell the user about gettext, pkg-config and sed
129
##
130 131 132 133 134 135
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
Typo  
Rémi Denis-Courmont committed
136
Also check if you have cvs, a dependency of autopoint.
137 138 139 140
Otherwise, you will not be able to build a source tarball.
EOF
fi

141
if [ "$PKGCONFIG" = "no" ]; then
142
  cat << EOF
143 144

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

150
echo "Successfully bootstrapped"