bootstrap 2.56 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

10 11 12 13
set -e

cd "$(dirname "$0")"

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

20 21
ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"

22
###
23
###  Get a sane environment, just in case
24
###
25 26
CYGWIN=binmode
export CYGWIN
27

28 29 30 31 32 33 34 35 36 37 38 39 40 41
# Check for contrib directory
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"
  fi
  if test ".`uname -s`" = ".Darwin"; then
    LD_LIBRARY_PATH=./extras/contrib/build/lib:$LD_LIBRARY_PATH
    DYLD_LIBRARY_PATH=./extras/contrib/build/lib:$DYLD_LIBRARY_PATH
    export LD_LIBRARY_PATH
    export DYLD_LIBRARY_PATH
  fi
fi

42 43 44 45
# Prepare m4/private.m4
rm -f m4/private.m4 && cat > m4/private.m4 << EOF
dnl  Private VLC macros - generated by bootstrap
EOF
46

47 48 49 50 51 52
# Check for pkg-config
if ! pkg-config --version >/dev/null 2>&1; then
	cat << EOF
NOTE: "pkg-config" is missing from your system.
Many underlying libraries will not be detected.
==============================================================
53

54 55 56 57
EOF
	cat >> m4/private.m4 << EOF
dnl  User does not have pkg-config, so assume package was not found
AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
58

59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
EOF
fi

# Check for autopoint (GNU gettext)
export AUTOPOINT
test "$AUTOPOINT" || AUTOPOINT=autopoint
if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
	AUTOPOINT=true
	cat << EOF
NOTE: GNU gettext appears to be missing or out-of-date.
Please install or update GNU gettext.
Also check if you have cvs, a dependency of autopoint.
Otherwise, you will not be able to build a source tarball.
==============================================================

EOF
fi
76

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

81
echo "generating modules/**/Makefile.am"
82 83 84 85 86 87 88
find modules/ -name Modules.am | \
sed -ne 's,modules/\(.*\)/Modules.am,\1,p' | \
while read d; do
	sh modules/genmf "$d"
	printf "."
done
printf "\n"
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
89

90 91
set -x

92
###
93
###  classic bootstrap stuff
94
###
95

96
# Automake complains if these are not present
97
echo > ABOUT-NLS
98
cp -f INSTALL INSTALL.git
Sam Hocevar's avatar
Sam Hocevar committed
99

100 101 102
autoreconf --install --force --verbose ${ACLOCAL_ARGS}
rm -f po/Makevars.template ABOUT-NLS
echo > ABOUT-NLS
103
mv -f INSTALL.git INSTALL
104 105

##
Sam Hocevar's avatar
Sam Hocevar committed
106
##  files which need to be regenerated
107
##
108
rm -f stamp-h*
109

110
# Shut up
111
set +x
112
echo "Successfully bootstrapped"