Chinaunix首页 | 论坛 | 博客
  • 博客访问: 959691
  • 博文数量: 261
  • 博客积分: 10026
  • 博客等级: 上将
  • 技术积分: 3420
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-24 12:10
个人简介

https://smart888.taobao.com/ 立观智能监控

文章分类

全部博文(261)

文章存档

2011年(1)

2010年(4)

2009年(256)

我的朋友

分类: LINUX

2009-08-24 21:56:43

#!/bin/bash

set -e

reconfig=0
remake=0
reinstall=0

case $1 in
  -m)
    remake=1;;
esac

export CUR_DIR=`pwd`                       
mkdir -p gtk-directfb
cd gtk-directfb

export TAR_DIR=`pwd`/source                       
export BLD_DIR=`pwd`/build                        
export ARCH=mipsel
export PREFIX=/opt/gtk-dfb                        
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

mkdir -p $TAR_DIR
mkdir -p $BLD_DIR


echo "##################################################"
echo "###### Install dependent ..."
echo "##################################################"
sudo apt-get -y install libtool gawk
sudo apt-get -y install gettext
sudo apt-get -y install libglib2.0-dev

echo "##################################################"
echo "###### Download source ..."
echo "##################################################"

cd $TAR_DIR

if [[ ! -e tiff-3.8.2.tar.gz ]]; then
wget ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz
fi
if [[ ! -e libxml2-sources-2.7.3.tar.gz ]]; then
wget
fi
if [[ ! -e freetype-2.3.9.tar.bz2 ]]; then
wget
fi
if [[ ! -e gtk+-2.16.5.tar.bz2 ]]; then
wget
fi
if [[ ! -e pango-1.24.5.tar.gz ]]; then
wget
fi
if [[ ! -e libpng-1.2.38.tar.bz2 ]]; then
wget
fi
if [[ ! -e tiff-3.8.2.tar.gz ]]; then
wget
fi
if [[ ! -e DirectFB-1.4.1.tar.gz ]]; then
wget
fi
if [[ ! -e linux-fusion-8.1.1.tar.gz ]]; then
wget
fi
if [[ ! -e cairo-1.8.8.tar.gz ]]; then
wget
fi
if [[ ! -e atk-1.26.0.tar.bz2 ]]; then
wget
fi
if [[ ! -e glib-2.20.4.tar.bz2 ]]; then
wget
fi
if [[ ! -e  gtk+-2.16.5.tar.bz2 ]]; then
wget
fi
if [[ ! -e jpegsrc.v6b.tar.gz ]]; then
wget ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
fi
if [[ ! -e tslib-1.0.tar.bz2 ]]; then
wget
fi
if [[ ! -e zlib-1.2.3.tar.gz ]]; then
wget
fi
if [[ ! -e pixman-0.15.20.tar.gz ]]; then
wget
fi

echo "##################################################"
echo "###### Building tslib ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e tslib-jz/tslib-0.1.1 ]]; then
tar -xjvf $TAR_DIR/tslib-1.0.tar.bz2
fi
cd tslib-jz/tslib-0.1.1
./autogen.sh
echo "ac_cv_func_malloc_0_nonnull=yes" > $ARCH-linux.cache
./configure --host=$ARCH-linux --prefix=$PREFIX --cache-file=$ARCH-linux.cache
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building glib ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e glib-2.20.4 ]]; then
tar -xjvf $TAR_DIR/glib-2.20.4.tar.bz2
fi
cd glib-2.20.4
echo ac_cv_type_long_long=yes > $ARCH-linux.cache
echo glib_cv_stack_grows=no >> $ARCH-linux.cache
echo glib_cv_uscore=no >> $ARCH-linux.cache
echo ac_cv_func_posix_getpwuid_r=yes >> $ARCH-linux.cache
echo ac_cv_func_posix_getgrgid_r=yes >> $ARCH-linux.cache
./configure --host=$ARCH-linux --prefix=$PREFIX --disable-gtk-doc --disable-man --cache-file=$ARCH-linux.cache
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building atk ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e atk-1.26.0 ]]; then
tar -xjvf $TAR_DIR/atk-1.26.0.tar.bz2
fi
cd atk-1.26.0
./configure --host=$ARCH-linux --prefix=$PREFIX --disable-gtk-doc
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building zlib ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e zlib-1.2.3 ]]; then
tar -xvf $TAR_DIR/zlib-1.2.3.tar.gz
fi
cd zlib-1.2.3
CC=$ARCH-linux-gcc ./configure --prefix=$PREFIX --shared
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building libjpeg ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e jpeg-6b ]]; then
tar -xvf $TAR_DIR/jpegsrc.v6b.tar.gz
fi
cd jpeg-6b
CC=$ARCH-linux-gcc ./configure --prefix=$PREFIX --disable-static
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building pixman ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e pixman-0.15.20 ]]; then
tar -xvf $TAR_DIR/pixman-0.15.20.tar.gz
fi
cd pixman-0.15.20
./configure --host=$ARCH-linux --prefix=$PREFIX --disable-gtk --disable-static
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building libpng ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e libpng-1.2.38 ]]; then
tar -xjvf $TAR_DIR/libpng-1.2.38.tar.bz2
fi
cd libpng-1.2.38
./configure --host=$ARCH-linux --prefix=$PREFIX --disable-static
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building freetype ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e freetype-2.3.9 ]]; then
tar -xjvf $TAR_DIR/freetype-2.3.9.tar.bz2
fi
cd freetype-2.3.9
./configure --host=$ARCH-linux --prefix=$PREFIX --disable-static
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building libxml ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e libxml2-2.7.3 ]]; then
tar -xvf $TAR_DIR/libxml2-sources-2.7.3.tar.gz
fi
cd libxml2-2.7.3
./configure --host=$ARCH-linux --prefix=$PREFIX --disable-static
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building fontconfig ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e fontconfig-2.7.1 ]]; then
tar -xvf $TAR_DIR/fontconfig-2.7.1.tar.gz
fi
cd fontconfig-2.7.1
./configure --host=$ARCH-linux --prefix=$PREFIX --with-freetype-config=$PREFIX/bin/freetype-config --with-arch=mips --disable-static --enable-libxml2 --disable-docs
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building tiff ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e tiff-3.8.2 ]]; then
tar -xvf $TAR_DIR/tiff-3.8.2.tar.gz
fi
cd tiff-3.8.2
./configure --host=$ARCH-linux --prefix=$PREFIX --disable-static --enable-rpath --without-x
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building directfb ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e DirectFB-1.4.1 ]]; then
tar -xvf $TAR_DIR/DirectFB-1.4.1.tar.gz
fi
cd DirectFB-1.4.1
./configure --host=$ARCH-linux --prefix=$PREFIX --with-gfxdrivers=none --enable-multi --enable-video4linux2 --enable-png --enable-jpeg --enable-tiff --enable-zlib --enable-sdl=no --enable-gif=no --disable-x11
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building cairo ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e cairo-1.8.8 ]]; then
tar -xvf $TAR_DIR/cairo-1.8.8.tar.gz
fi
cd cairo-1.8.8
./configure --host=$ARCH-linux --prefix=$PREFIX --disable-static --disable-gtk-doc --without-x --disable-xcb --disable-xlib --disable-xlib-xrender --enable-png --enable-directfb --enable-freetype --disable-win32
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building pango ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e pango-1.24.5 ]]; then
tar -xvf $TAR_DIR/pango-1.24.5.tar.gz
fi
cd pango-1.24.5
sed -i -e 's/have_cairo=false/have_cairo=true/g' configure
sed -i -e 's/have_cairo_png=false/have_cairo_png=true/g' configure
sed -i -e 's/have_cairo_freetype=false/have_cairo_freetype=true/g' configure
sed -i -e 's/have_cairo_ps=false/have_cairo_ps=true/g' configure
sed -i -e 's/have_cairo_pdf=false/have_cairo_pdf=true/g' configure
./configure --host=$ARCH-linux --prefix=$PREFIX --disable-doc-cross-references --without-x --cache-file=$ARCH-linux.cache
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

echo "##################################################"
echo "###### Building gtk ..."
echo "##################################################"
cd $BLD_DIR
if [[ ! -e gtk+-2.16.5 ]]; then
tar -xvjf $TAR_DIR/gtk+-2.16.5.tar.bz2
patch gtk+-2.16.5/configure $CUR_DIR/gtk+-2.16.5-link.patch
fi
cd gtk+-2.16.5
echo ac_cv_path_GTK_UPDATE_ICON_CACHE=/usr/bin/gtk-update-icon-cache > $ARCH-linux.cache
echo ac_cv_path_GDK_PIXBUF_CSOURCE=/usr/bin/gdk-pixbuf-csource >> $ARCH-linux.cache
echo gio_can_sniff=yes >> $ARCH-linux.cache
./configure --host=$ARCH-linux --prefix=$PREFIX --with-gdktarget=directfb --without-x --without-libjasper --cache-file=$ARCH-linux.cache
if [[ "$remake" -gt 0 ]]; then
make clean
fi
make all
make install

unset CUR_DIR TAR_DIR BLD_DIR ARCH PREFIX PKG_CONFIG_PATH
阅读(1462) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~