Chinaunix首页 | 论坛 | 博客
  • 博客访问: 433792
  • 博文数量: 53
  • 博客积分: 2746
  • 博客等级: 少校
  • 技术积分: 829
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-14 10:41
文章分类

全部博文(53)

文章存档

2016年(2)

2013年(1)

2012年(7)

2011年(10)

2010年(5)

2009年(20)

2008年(8)

我的朋友

分类: LINUX

2011-04-05 10:47:32

一、下载源码:
    wget
     svn co svn://svn.savannah.nongnu.org/qemu/trunk qemu
 
二、按 readme 编译:
    1. /autogen.sh
    2. make install prefix=$HOME/sb2
 
    出错:
  
make
make[1]: Entering directory `/home/longjindong/src/sbox2-2.0'
[CC] luaif/sb_log.o
In file included from luaif/sb_log.c:49:
/home/longjindong/src/sbox2-2.0/preload/exported.h:505: error: conflicting types for ‘scandir’
/usr/include/dirent.h:252: note: previous declaration of ‘scandir’ was here
/home/longjindong/src/sbox2-2.0/preload/exported.h:521: error: conflicting types for ‘scandir64’
/usr/include/dirent.h:275: note: previous declaration of ‘scandir64’ was here
luaif/sb_log.c: In function ‘write_to_logfile’:
luaif/sb_log.c:116: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
make[1]: *** [luaif/sb_log.o] Error 1
make[1]: Leaving directory `/home/longjindong/src/sbox2-2.0'
make: *** [regular] Error 2
   
    打补解决:
       

在 preload/interface.master 中把:

WRAP: int scandir(const char *dir, struct dirent ***namelist, \
-        SCANDIR_TYPE_ARG3, int(*compar)(const void *, const void *)) : \
+        SCANDIR_TYPE_ARG3, int(*compar)(const struct dirent **, const struct dirent **)) : \

#ifdef HAVE_OSX_SCANDIR
-WRAP: int scandir(const char *dirname, struct dirent ***namelist, int (*select)(struct dirent *), int (*compar)(const void *, const void *)): map(dirname)
+WRAP: int scandir(const char *dirname, struct dirent ***namelist, int (*select)(struct dirent *), int (*compar)(const struct dirent **, const struct dirent **)): map(dirname)

#ifdef HAVE_SCANDIR64
WRAP: int scandir64(const char *dir, struct dirent64 ***namelist, \
        int(*filter)(const struct dirent64 *), \
-        int(*compar)(const void *, const void *)) : \
+        int(*compar)(const struct dirent64 **, const struct dirent64 **)) : \

此补丁来自:

 
三、编译 qemu :
       $ svn co svn://svn.savannah.nongnu.org/qemu/trunk qemu
       $ cd qemu
       $ ./configure --prefix=$HOME/sb2 --target-list=arm-linux-user
    
      这里出错:    
       
preadv support    yes
The error log from compiling the libSDL test is:
/tmp/qemu-conf--359-.c:1:17: error: SDL.h: No such file or directory
/tmp/qemu-conf--359-.c: In function ‘main’:
/tmp/qemu-conf--359-.c:3: error: ‘SDL_INIT_VIDEO’ undeclared (first use in this function)
/tmp/qemu-conf--359-.c:3: error: (Each undeclared identifier is reported only once
/tmp/qemu-conf--359-.c:3: error: for each function it appears in.)
 
      解决:
       $ sudo apt-get install libsdl1.2-dev

       $ make && make install  (自动安装到和上面 sb2 一样的目录(/home/longjindong/sb2/bin)).
    
四、 把上面产生的命令加到环境变量:
       1. $ vi $HOME/.bashrc
       在后面加上:
          export PATH=$PATH:$HOME/sb2/bin
       记得保存退出。
       2. source  $HOME/.bashrc    #使设置生效。
 
编译安装到此结束。
 
 
 
   
阅读(1789) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~