]> git.sesse.net Git - vlc/blob - extras/package/macosx/build.sh
macosx: added a basic traffic lights icon set for the dark window and the related...
[vlc] / extras / package / macosx / build.sh
1 #!/bin/sh
2 set -e
3
4 info()
5 {
6     echo " [build] $1"
7 }
8
9 usage()
10 {
11 cat << EOF
12 usage: $0 [options]
13
14 OPTIONS:
15    -h            Show some help
16 EOF
17
18 }
19
20 spushd()
21 {
22     pushd "$1" > /dev/null
23 }
24
25 spopd()
26 {
27     popd > /dev/null
28 }
29
30 while getopts "h" OPTION
31 do
32      case $OPTION in
33          h)
34              usage
35              exit 1
36              ;;
37      esac
38 done
39 shift $(($OPTIND - 1))
40
41 if [ "x$1" != "x" ]; then
42     usage
43     exit 1
44 fi
45
46 info "Building VLC for the Mac OS X"
47
48 spushd `dirname $0`/../../..
49 vlcroot=`pwd`
50 spopd
51
52 builddir="${vlcroot}/build-macosx"
53
54 export CC=/Developer/usr/bin/llvm-gcc-4.2
55 export CXX=/Developer/usr/bin/llvm-g++-4.2
56 export OBJC=/Developer/usr/bin/llvm-gcc-4.2
57
58 spushd "${vlcroot}/extras/contrib"
59 ./bootstrap
60 make
61 spopd
62
63 mkdir -p "${builddir}"
64
65 if ! [ -e "${vlcroot}/configure" ]; then
66     ${vlcroot}/bootstrap
67 fi
68
69 spushd "${builddir}"
70
71 # Run configure only upon changes.
72 if [ "${vlcroot}/configure" -nt config.log ]; then
73   ${vlcroot}/configure \
74       --enable-debug
75 fi
76
77 core_count=`sysctl -n machdep.cpu.core_count`
78 let jobs=$core_count+1
79
80 info "Running make -j$jobs"
81
82 make -j$jobs
83 spopd
84