bootstrap 2.84 KB
Newer Older
1
2
3
4
#!/bin/sh
# ***************************************************************************
# bootstrap : Set up config.mak
# ***************************************************************************
5
# Copyright (C) 2003 the VideoLAN team
6
# $Id$
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
# Authors: Christophe Massiot <massiot@via.ecp.fr>
#
# 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
# ***************************************************************************

25
26
if test "$#" -gt "1"; then
  echo "Usage: $0 <host>" >&2
27
28
29
30
31
32
33
34
35
  echo "  Prepare config.mak file." >&2
  exit 1
fi

LANG=C
export LANG
set -e
set -x

36
37
38
BUILD=`gcc -dumpmachine`
if test "$#" = "1"; then
  HOST="$1"
39
else
40
  HOST="$BUILD"
41
42
fi

43
44
45
46
47
48
echo -e "# Automatically generated by bootstrap.\n# Make changes if you know what you're doing.\n" >| config.mak

echo "BUILD = $BUILD" >> config.mak
echo "HOST = $HOST" >> config.mak

case $HOST in
49
50
    ppc-darwin)
# Mac OS X < 10.4
51
	    echo "EXTRA_CPPFLAGS = -no-cpp-precomp" >> config.mak
52
53
54
55
56
57
58
59
60
61
62
	;;
    powerpc-apple-darwin8)
# Mac OS X 10.4
# Makefile cross compiling is only supported with gcc-4.0
# ENVP defines the oldest environment on which the program will be able to run
# SDK 10.2.8 requires gcc-3.3 (so we cannot use that SDK)
            echo "ENVP = MACOSX_DEPLOYMENT_TARGET=10.3" >> config.mak
	    echo "MACOSX_SDK = /Developer/SDKs/MacOSX10.3.9.sdk" >> config.mak
#	    echo "EXTRA_CFLAGS = -D\${ENVP} -isysroot \${MACOSX_SDK}" >> config.mak
	    echo "EXTRA_CPPFLAGS = -no-cpp-precomp" >> config.mak
	    echo "EXTRA_LDFLAGS = -isysroot \${MACOSX_SDK} -syslibroot,\${MACOSX_SDK}" >> config.mak
63
64
65
66
67
68
69
70
        ;;
    i586-pc-beos)
	    echo "EXTRA_LDFLAGS = -lnet" >> config.mak
        ;;
    *)
        ;;
esac

71
72
if which curl >/dev/null; then
	echo "WGET = curl -O" >> config.mak
73
elif wget --version >/dev/null 2>&1; then
74
75
76
77
78
79
	echo "WGET = wget" >> config.mak
else
	echo "You need at least wget or curl to fetch the packages." >&2
	exit 1
fi

bigben's avatar
bigben committed
80
81
if test -f /sw/bin/svn; then
        echo "SVN = /sw/bin/svn" >> config.mak
82
83
elif test -f /usr/local/bin/svn; then
        echo "SVN = /usr/local/bin/svn" >> config.mak
bigben's avatar
bigben committed
84
85
86
87
88
elif svn help >/dev/null 2>&1; then
        echo "SVN = svn" >> config.mak
else
        echo "You do not have a subversion client installed." >&2
fi
89

90
echo "PREFIX = `pwd`" >> config.mak