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

3
##  bootstrap file for the VLC media player
4
##
5
## Copyright (C) 2005-2006 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
  export 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 38 39 40 41 42 43
  if test ".`uname -s`" = ".Darwin"; then
    export LD_LIBRARY_PATH=./extras/contrib/lib:$LD_LIBRARY_PATH
    export DYLD_LIBRARY_PATH=./extras/contrib/lib:$DYLD_LIBRARY_PATH
  elif test ".`uname -s`" = ".BeOS"; then
    export LIBRARY_PATH=./extras/contrib/lib:$LIBRARY_PATH
    export BELIBRARIES=./extras/contrib/lib:$BELIBRARIES
  fi
44
elif test ".`uname -s`" = ".Darwin"; then
45 46 47 48 49 50 51 52 53 54 55
  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
56 57
fi

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

66 67 68 69
##
## Generate the modules makefile, by parsing modules/**/Modules.am
##

70
set +x
71
echo "generating modules/**/Makefile.am and m4/private.m4"
72

Sam Hocevar's avatar
Sam Hocevar committed
73
# Prepare m4/private.m4
Sam Hocevar's avatar
Sam Hocevar committed
74
rm -f m4/private.m4 && cat > m4/private.m4 << EOF
75
dnl  Private VLC macros - generated by bootstrap
76 77

EOF
Gildas Bazin's avatar
 
Gildas Bazin committed
78 79

if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
80 81
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
82 83 84 85

EOF
fi

86
cat >> m4/private.m4 << EOF
Sam Hocevar's avatar
Sam Hocevar committed
87
dnl  Helper macro for vlc-config generation
Sam Hocevar's avatar
Sam Hocevar committed
88
AC_DEFUN([VLC_CONFIG_HELPER], [
Sam Hocevar's avatar
Sam Hocevar committed
89 90
  cat >> vlc-config.in << BLAH
EOF
91 92 93

modules=""

Sam Hocevar's avatar
Sam Hocevar committed
94 95 96
rm -f modules/Makefile.am && cat > modules/Makefile.am << EOF
# Autogenerated by bootstrap - DO NOT EDIT
EXTRA_DIST = LIST
97
dist_noinst_SCRIPTS = genmf
Sam Hocevar's avatar
Sam Hocevar committed
98
SUBDIRS = `sed -ne 's,modules/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`
Sam Hocevar's avatar
Sam Hocevar committed
99

100
EOF
101

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

104
cat >> m4/private.m4 << EOF
Sam Hocevar's avatar
Sam Hocevar committed
105
BLAH
106 107
])
EOF
108

109
###
110
###  classic bootstrap stuff
111
###
112
set -x
113

114
# Automake complains if these are not present
115
echo > vlc-config.in
116
cp -f INSTALL INSTALL.svn
Sam Hocevar's avatar
Sam Hocevar committed
117

118
autoreconf --install --force --verbose ${ACLOCAL_ARGS}
119
rm -f po/Makevars.template
120
echo > ABOUT-NLS
121
mv -f INSTALL.svn INSTALL
122 123

##
Sam Hocevar's avatar
Sam Hocevar committed
124
##  files which need to be regenerated
125
##
Sam Hocevar's avatar
Sam Hocevar committed
126
rm -f vlc-config.in vlc-config
127
rm -f src/misc/modules_builtin.h
128
rm -f stamp-builtin stamp-h* mozilla/stamp-pic
129

130
# Shut up
131
set +x
132

133
##
134
##  Tell the user about gettext, pkg-config and sed
135
##
136
if [ "$PKGCONFIG" = "no" ]; then
137
  cat << EOF
138 139 140 141 142 143

==============================================================
NOTE: you do not have the "pkg-config" utility on your system;
detection of the Gtk-2.0 and GNOME 2.0 libraries will not be
reliable.
EOF
144
fi
145

146
echo "Successfully bootstrapped"