Converted these images to PNG, saving a handful of bytes per image
[adiumx.git] / Utilities / dep-build-scripts / general_dependencies_make.sh
blob3fa79c976bd422c256e6087577ac615577b16cf9
1 #!/bin/sh
2 LOG_FILE=$PWD/dep_make.log
3 echo "Beginning build at" `date` > $LOG_FILE 2>&1
5 PKGCONFIG=pkg-config-0.22
6 GETTEXT=gettext-0.16.1
7 GLIB=glib-2.14.1
9 BASE_CFLAGS="-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
10 BASE_LDFLAGS="-mmacosx-version-min=10.4 -headerpad_max_install_names -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
12 NUMBER_OF_CORES=`sysctl -n hw.activecpu`
14 mkdir build >/dev/null 2>&1 || true
15 cd build
16 mkdir universal >/dev/null 2>&1 || true
18 TARGET_DIR_PPC="$PWD/root-ppc"
19 TARGET_DIR_I386="$PWD/root-i386"
20 TARGET_DIR_BASE="$PWD/root"
21 export PATH_PPC="$TARGET_DIR_PPC/bin:$PATH"
22 export PATH_I386="$TARGET_DIR_I386/bin:$PATH"
24 #pkg-config
25 # We only need a native pkg-config, it's not a runtime dependency,
26 # but we need a native one in both directories
27 #unset CFLAGS
28 echo 'Building pkg-config for i386...'
29 TARGET_DIR=$TARGET_DIR_I386
30 mkdir pkg-config-`arch` >/dev/null 2>&1 || true
31 cd pkg-config-`arch`
32 echo ' Configuring...'
33 ../../$PKGCONFIG/configure --prefix="$TARGET_DIR" >> $LOG_FILE 2>&1
34 echo ' make && make install'
35 make -j $NUMBER_OF_CORES >> $LOG_FILE 2>&1 && make install >> $LOG_FILE 2>&1
36 cd ..
38 echo 'pkg-config for ppc...'
39 TARGET_DIR=$TARGET_DIR_PPC
40 mkdir pkg-config-`arch` >/dev/null 2>&1 || true
41 cd pkg-config-`arch`
42 echo ' Configuring...'
43 ../../$PKGCONFIG/configure --prefix="$TARGET_DIR" >> $LOG_FILE 2>&1
44 echo ' make && make install'
45 make -j $NUMBER_OF_CORES >> $LOG_FILE 2>&1 && make install >> $LOG_FILE 2>&1
46 cd ..
48 #gettext
49 # caveat - some of the build files in gettext appear to not respect CFLAGS
50 # and are compiling to `arch` instead of $ARCH. Lame.
51 for ARCH in ppc i386 ; do
52 echo "Building gettext for $ARCH"
53 export CFLAGS="$BASE_CFLAGS -arch $ARCH"
54 export CXXFLAGS="$CFLAGS"
55 export LDFLAGS="$BASE_LDFLAGS -arch $ARCH"
56 case $ARCH in
57 ppc) HOST=powerpc-apple-darwin8
58 export PATH=$PATH_PPC;;
59 i386) HOST=i686-apple-darwin8
60 export PATH=$PATH_I386;;
61 esac
62 mkdir gettext-$ARCH >/dev/null 2>&1 || true
63 cd gettext-$ARCH
64 TARGET_DIR=$TARGET_DIR_BASE-$ARCH
65 echo ' Configuring...'
66 ../../$GETTEXT/configure --prefix=$TARGET_DIR --disable-static \
67 --enable-shared --host=$HOST >> $LOG_FILE 2>&1
68 echo ' make && make install'
69 make -j $NUMBER_OF_CORES >> $LOG_FILE 2>&1 && make install >> $LOG_FILE 2>&1
70 cd ..
71 done
73 #glib
74 for ARCH in ppc i386; do
75 echo "Building glib for $ARCH"
76 LOCAL_BIN_DIR="$TARGET_DIR_BASE-$ARCH/bin"
77 LOCAL_LIB_DIR="$TARGET_DIR_BASE-$ARCH/lib"
78 LOCAL_INCLUDE_DIR="$TARGET_DIR_BASE-$ARCH/include"
79 LOCAL_FLAGS="-L$LOCAL_LIB_DIR -I$LOCAL_INCLUDE_DIR -lintl -liconv"
80 export PKG_CONFIG="$LOCAL_BIN_DIR/pkg-config"
81 export MSGFMT="$LOCAL_BIN_DIR/msgfmt"
83 export CFLAGS="$LOCAL_FLAGS $BASE_CFLAGS -arch $ARCH"
84 export CPPFLAGS="$CFLAGS"
85 export LDFLAGS="$LOCAL_FLAGS $BASE_LDFLAGS -arch $ARCH"
86 case $ARCH in
87 ppc) HOST=powerpc-apple-darwin8;;
88 i386) HOST=i686-apple-darwin8;;
89 esac
90 mkdir glib-$ARCH >/dev/null 2>&1 || true
91 cd glib-$ARCH
92 TARGET_DIR=$TARGET_DIR_BASE-$ARCH
93 echo ' Configuring...'
94 ../../$GLIB/configure \
95 --prefix=$TARGET_DIR \
96 --with-libiconv \
97 --disable-static --enable-shared \
98 --host=$HOST >> $LOG_FILE 2>&1
99 echo ' make && make install'
100 make -j $NUMBER_OF_CORES >> $LOG_FILE 2>&1 && make install >> $LOG_FILE 2>&1
101 cd ..
102 done
104 #libogg
105 #libvorbis
106 #libspeex
107 #libtheora
108 #taglib
109 #liboil - 3 patches
110 #gstreamer
111 #gst-plugins-base
112 #gst-plugins-good
113 #gst-plugins-bad