]> git.sesse.net Git - vlc/blob - extras/contrib/bootstrap
* don't try to use & in a string and fix it correctly. sorry for the previous commit
[vlc] / extras / contrib / bootstrap
1 #!/bin/sh
2 # ***************************************************************************
3 # bootstrap : Set up config.mak
4 # ***************************************************************************
5 # Copyright (C) 2003 the VideoLAN team
6 # $Id$
7 #
8 # Authors: Christophe Massiot <massiot@via.ecp.fr>
9 #
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
14 #
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23 # ***************************************************************************
24
25 if test "$#" -gt "1"; then
26   echo "Usage: $0 <host>" >&2
27   echo "  Prepare config.mak file." >&2
28   exit 1
29 fi
30
31 LANG=C
32 export LANG
33 set -e
34 set -x
35
36 BUILD=`gcc -dumpmachine`
37 if test "$#" = "1"; then
38   HOST="$1"
39 else
40   HOST="$BUILD"
41 fi
42
43 echo -e "# Automatically generated by bootstrap.\n# Make changes if you know what you're doing.\n" >| config.mak
44
45 echo "BUILD = $BUILD" >> config.mak
46 echo "HOST = $HOST" >> config.mak
47
48 case $HOST in
49     ppc-darwin)
50 # Mac OS X < 10.4
51             echo "EXTRA_CPPFLAGS = -no-cpp-precomp" >> config.mak
52         ;;
53     powerpc-apple-darwin8)
54 # Mac OS X 10.4
55 # Makefile cross compiling is only supported with gcc-4.0
56 # ENVP defines the oldest environment on which the program will be able to run
57 # SDK 10.2.8 requires gcc-3.3 (so we cannot use that SDK)
58             echo "ENVP = MACOSX_DEPLOYMENT_TARGET=10.3" >> config.mak
59             echo "MACOSX_SDK = /Developer/SDKs/MacOSX10.3.0.sdk" >> config.mak
60 #           echo "EXTRA_CFLAGS = -D\${ENVP} -isysroot \${MACOSX_SDK}" >> config.mak
61             echo "EXTRA_CPPFLAGS = -no-cpp-precomp" >> config.mak
62 #           echo "EXTRA_LDFLAGS = -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}" >> config.mak
63         ;;
64     i586-pc-beos)
65             if test -f /boot/beos/system/lib/libbind.so; then
66                 echo "EXTRA_LDFLAGS = -lbind -lsocket" >> config.mak
67             else
68                 echo "EXTRA_LDFLAGS = -lnet" >> config.mak
69             fi
70         ;;
71     *)
72         ;;
73 esac
74
75 if which curl >/dev/null; then
76         echo "WGET = curl -O" >> config.mak
77 elif wget --version >/dev/null 2>&1; then
78         echo "WGET = wget" >> config.mak
79 else
80         echo "You need at least wget or curl to fetch the packages." >&2
81         exit 1
82 fi
83
84 if test -f /sw/bin/svn; then
85         echo "SVN = /sw/bin/svn" >> config.mak
86 elif test -f /usr/local/bin/svn; then
87         echo "SVN = /usr/local/bin/svn" >> config.mak
88 elif svn help >/dev/null 2>&1; then
89         echo "SVN = svn" >> config.mak
90 else
91         echo "You do not have a subversion client installed." >&2
92 fi
93
94 echo "PREFIX = `pwd`" >> config.mak