bootstrap 1.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/bin/sh
# Copyright © 2011 Rafaël Carré
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.

export LC_ALL=
NEEDED=

if [ ! -f tools.mak ]
then
	echo "You must run me in ./extras/tools !"
	exit 1
fi

check() {
28
# FIXME : add version check: automake 1.11, autoconf 2.67 libtool 2.2
Rafaël Carré's avatar
Rafaël Carré committed
29
if ! $1 --version >/dev/null 2>&1
30 31 32 33 34 35 36 37 38 39 40 41
then
    echo "$1 not found"
    NEEDED="$NEEDED .$1"
fi
}

check autoconf
check automake
check libtool
check pkg-config
check xz
check cmake
Rafaël Carré's avatar
Rafaël Carré committed
42
check yasm
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70

[ -n "$NEEDED" ] && mkdir -p build/

CPUS=
case `uname` in
    Linux)
        CPUS=`grep -c ^processor /proc/cpuinfo`
     ;;
    Darwin)
        CPUS=`sysctl hw.ncpu|cut -d: -f2`
    ;;
    *)
        CPUS=1  # default
     ;;
esac


cat > Makefile << EOF
MAKEFLAGS += -j$CPUS
PREFIX=\$(abspath ./build)

all: $NEEDED
	@echo "You are ready to build VLC and its contribs"

automake: .autoconf

include tools.mak
EOF