bootstrap 3.15 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 74
# 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

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

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

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

EOF
Gildas Bazin's avatar
 
Gildas Bazin committed
87 88

if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
89 90
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
91 92 93 94

EOF
fi

95
sh modules/genmf `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
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
Sam Hocevar's avatar
Sam Hocevar committed
106

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

##
Sam Hocevar's avatar
Sam Hocevar committed
113
##  files which need to be regenerated
114
##
Sam Hocevar's avatar
Sam Hocevar committed
115
rm -f vlc-config.in vlc-config
116
rm -f stamp-h*
117

118
# Shut up
119
set +x
120

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

135
if [ "$PKGCONFIG" = "no" ]; then
136
  cat << EOF
137 138

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

144
echo "Successfully bootstrapped"