Chinaunix首页 | 论坛 | 博客
  • 博客访问: 693225
  • 博文数量: 182
  • 博客积分: 2088
  • 博客等级: 大尉
  • 技术积分: 1698
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-16 15:09
个人简介

.

文章分类

全部博文(182)

文章存档

2016年(1)

2015年(18)

2014年(14)

2013年(20)

2012年(129)

分类: 嵌入式

2012-06-15 17:18:59

1.1. 新建minigui目录:mkdir minigui
1.2. 拷贝libminigui-1.3.3.tar.gz到minigui目录,并在minigui目录下新建一目录miniguku
1.3. 配置
./configure \
    --with-style=fashion \
    --disable-galqvfb \
    --disable-qvfbial \
    --disable-static \
    --enable-jz4740ial \
    --enable-galfbcon \
    --enable-fblin16 \
    --disable-micemoveable \
    --disable-cursor \
    --disable-vbfsupport \
    --disable-latin9support \
    --disable-big5support \
    --disable-savebitmap \
    --enable-jpgsupport \
    --enable-pngsupport \
    --disable-imegb2312 \
    --disable-aboutdlg \
    --disable-savescreen \
    --build=i386-linux \
    --host=mipsel-linux \
--target=mipsel-linux \
--prefix=/opt/project/uto/minigui/miniguiku
显示如下:
checking build system type... i386-pc-linux-gnu
checking host system type... mipsel-unknown-linux-gnu
checking target system type... mipsel-unknown-linux-gnu
checking for mipsel-linux-gcc... mipsel-linux-gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mipsel-linux-gcc accepts -g... yes
checking for mipsel-linux-gcc option to accept ANSI C... none needed
checking for ld used by GCC... /opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux/bin/ld
checking if the linker (/opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux/bin/ld) is GNU ld... yes
checking for /opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /opt/project/ToolChain/mipseltools-gcc-4.1.2/bin/mipsel-linux-nm -B
checking whether ln -s works... yes
checking how to recognise dependant libraries... file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )
checking command to parse /opt/project/ToolChain/mipseltools-gcc-4.1.2/bin/mipsel-linux-nm -B output... ok
checking how to run the C preprocessor... mipsel-linux-gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for mipsel-linux-file... no
checking for file... /usr/bin/file
checking for mipsel-linux-ranlib... mipsel-linux-ranlib
checking for mipsel-linux-strip... mipsel-linux-strip
checking for objdir... .libs
checking for mipsel-linux-gcc option to produce PIC... -fPIC
checking if mipsel-linux-gcc PIC flag -fPIC works... yes
checking if mipsel-linux-gcc static flag -static works... yes
checking if mipsel-linux-gcc supports -c -o file.o... yes
checking if mipsel-linux-gcc supports -c -o file.lo... yes
checking if mipsel-linux-gcc supports -fno-rtti -fno-exceptions... yes
checking whether the linker (/opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether -lc should be explicitly linked in... no
creating libtool
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking whether build environment is sane... yes
checking for gawk... gawk
checking for style of include used by make... GNU
checking for mipsel-linux-strip... (cached) mipsel-linux-strip
checking dependency style of mipsel-linux-gcc... gcc3
checking for ANSI C header files... (cached) yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for sys/types.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking termio.h usability... yes
checking termio.h presence... yes
checking for termio.h... yes
checking for unistd.h... (cached) yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for working alloca.h... yes
checking for alloca... yes
checking for working memcmp... no
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... no
checking for vprintf... yes
checking for _doprnt... no
checking for gettimeofday... yes
checking for alloca... no
checking for strdup... yes
checking for strcasecmp... yes
checking for strerror... yes
checking for setenv... yes
checking for tmpfile... yes
checking for FrameBuffer console support... yes
checking for pthread library... yes
checking for TT_FreeType_Version in -lttf... no
checking for T1_InitLib in -lt1... no
checking for jpeg_std_error in -ljpeg... yes
checking for png_check_sig in -lpng... yes
checking for pow in -lm... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/control/Makefile
config.status: creating src/font/Makefile
config.status: creating src/font/in-core/Makefile
config.status: creating src/gal/Makefile
config.status: creating src/gal/native/Makefile
config.status: creating src/newgal/Makefile
config.status: creating src/newgal/fbcon/Makefile
config.status: creating src/newgal/qvfb/Makefile
config.status: creating src/newgal/ecoslcd/Makefile
config.status: creating src/newgal/dummy/Makefile
config.status: creating src/ial/Makefile
config.status: creating src/ial/native/Makefile
config.status: creating src/mybmp/Makefile
config.status: creating src/gdi/Makefile
config.status: creating src/newgdi/Makefile
config.status: creating src/gui/Makefile
config.status: creating src/ime/Makefile
config.status: creating src/misc/Makefile
config.status: creating src/main/Makefile
config.status: creating src/kernel/Makefile
config.status: creating src/server/Makefile
config.status: creating src/client/Makefile
config.status: creating src/standalone/Makefile
config.status: creating src/sysres/Makefile
config.status: creating src/include/Makefile
config.status: creating src/include/control/Makefile
config.status: creating ext/Makefile
config.status: creating ext/control/Makefile
config.status: creating ext/mywins/Makefile
config.status: creating ext/skin/Makefile
config.status: creating ext/image/Makefile
config.status: creating ext/include/Makefile
config.status: creating ext/res/Makefile
config.status: creating examples/Makefile
config.status: creating vcongui/Makefile
config.status: creating include/Makefile
config.status: creating etc/Makefile
config.status: creating m4/Makefile
config.status: creating configs/Makefile
config.status: creating scripts/Makefile
config.status: creating scripts/lxdialog/Makefile
config.status: creating config.h
config.status: executing depfiles commands
1.4. make && make install
make时出现如下错误:
......
grid.c: In function 'AddCol':
grid.c:626: error: invalid lvalue in assignment
grid.c:627: error: invalid lvalue in assignment
grid.c:638: error: invalid lvalue in assignment
grid.c:639: error: invalid lvalue in assignment
grid.c:667: error: invalid lvalue in assignment
grid.c:668: error: invalid lvalue in assignment
grid.c:680: error: invalid lvalue in assignment
grid.c:681: error: invalid lvalue in assignment
grid.c: In function 'AddRow':
grid.c:733: error: invalid lvalue in assignment
grid.c:734: error: invalid lvalue in assignment
grid.c:745: error: invalid lvalue in assignment
grid.c:746: error: invalid lvalue in assignment
grid.c:774: error: invalid lvalue in assignment
grid.c:775: error: invalid lvalue in assignment
grid.c:788: error: invalid lvalue in assignment
grid.c:789: error: invalid lvalue in assignment
make[3]: *** [grid.lo] Error 1
make[3]: Leaving directory `/opt/.../minigui/libminigui-1.3.3/ext/control'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/.../minigui/libminigui-1.3.3/ext'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/.../minigui/libminigui-1.3.3'
make: *** [all] Error 2
修改minigui\libminigui-1.3.3\ext\control\grid.c如下:
In function 'AddCol' and 'AddRow'
      (PGRIDCOLHDR)pCell1->pRowHdr = pRowHdr;--->pCell1->pRowHdr = pRowHdr;
      (PGRIDCOLHDR)pCell1->pColHdr = pCol1;--->pCell1->pColHdr = pCol1;
      (PGRIDCOLHDR)pCell2->pColHdr = pCol2;--->pCell2->pColHdr = pCol2;
      (PGRIDROWHDR)pCell2->pRowHdr = pRowHdr;--->pCell2->pRowHdr = pRowHdr;
      (PGRIDCOLHDR)pCell3->pColHdr = pCol2;--->pCell3->pColHdr = pCol2;
      (PGRIDROWHDR)pCell3->pRowHdr = pRowHdr;--->pCell3->pRowHdr = pRowHdr;
      (PGRIDCOLHDR)pCell3->pColHdr = pCol2;--->pCell3->pColHdr = pCol2;
      (PGRIDROWHDR)pCell3->pRowHdr = pRowHdr;--->pCell3->pRowHdr = pRowHdr;
然后再make即可通过
接着make install,将在miniguiku目录下生成etc、include、lib目录及内包含的相应文件
可以将相应的lib和etc拷贝到rootfs目录下的相应位置,这样真正的机器上便可以运行相关minigui了
ps:1. 在配置时,如果将prefix指定为rootfs目录,这样就不需要手动拷贝lib内相关文件了(--prefix=/opt/.../fs/rootfs\),然后将/etc下的MiniGUI.cfg拷贝到/usr/local/etc下
2. 最好的方法是prefix指定为交叉编译器的位置,这样在编程时会比较方便,一般在机器运行编程的程序需要的只是lib库就可以了,在制作rootfs时,一般都会将交叉编译器下的lib拷贝到rootfs的lib下(--prefix=/opt/.../ToolChain/mipsel-linux-gcc-4.1.2/mipsel-linux\),然后将/etc下的MiniGUI.cfg拷贝到/usr/local/etc下
2.1. 拷贝minigui-res-1.3.3.tar.gz到minigui目录下,并解压:tar xzvf minigui-res-1.3.3.tar.gz
拷贝bmp cursor font icon imetab到rootfs的/usr/local/minigui/res目录下
3.1 拷贝mg-samples-1.3.0.tar.gz到minigui目录下,并解压:tar xzvf mg-samples-1.3.0.tar.gz
___________________________________________________________________________________
在按默认的方式编译minigui,并能在PC上运行Hello,World后,再针对minigui的移植
先make clean或make distclean,清除之前编译的生成,后:
./configure \
    --prefix=/opt/project/uto/minigui/miniguiku \
    --with-style=fashion \
    --disable-galqvfb \
    --disable-qvfbial \
    --disable-static \
    --enable-jz4740ial \
    --enable-galfbcon \
    --enable-fblin16 \
    --disable-micemoveable \
    --disable-cursor \
    --disable-vbfsupport \
    --disable-latin9support \
    --disable-big5support \
    --disable-savebitmap \
    --enable-jpgsupport \
    --enable-pngsupport \
    --disable-imegb2312 \
    --disable-aboutdlg \
    --disable-savescreen \
    --build=i386-linux \
    --host=mipsel-linux \
    --target=mipsel-linux
再make,出现错误:
mipsel-linux-gcc -shared template.lo -Wl,--whole-archive control/.libs/libcontrol.al font/.libs/libfont.al ial/.libs/libial.al gui/.libs/libgui.al ime/.libs/libime.al main/.libs/libmain.al misc/.libs/libmisc.al mybmp/.libs/libmybmp.al kernel/.libs/libkernel.al sysres/.libs/libsysres.al newgal/.libs/libnewgal.al newgdi/.libs/libnewgdi.al -Wl,--no-whole-archive control/.libs/libcontrol.al font/.libs/libfont.al ial/.libs/libial.al gui/.libs/libgui.al ime/.libs/libime.al main/.libs/libmain.al misc/.libs/libmisc.al mybmp/.libs/libmybmp.al kernel/.libs/libkernel.al sysres/.libs/libsysres.al newgal/.libs/libnewgal.al newgdi/.libs/libnewgdi.al /usr/lib/libjpeg.so -lpng -lm -Wl,-soname -Wl,libminigui-1.3.so.3 -o .libs/libminigui-1.3.so.3.0.0
/usr/lib/libjpeg.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[3]: *** [libminigui.la] Error 1
make[3]: Leaving directory `/opt/project/uto/minigui/libminigui-1.3.3/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/project/uto/minigui/libminigui-1.3.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/project/uto/minigui/libminigui-1.3.3'
make: *** [all] Error 2
显然是jpeg库的问题,下载jpeg库,用交叉编译器重新编译,并在jpegku目录下生成相应的lib、*.h等
然后重新配置一下
./configure \
    --prefix=/opt/project/uto/minigui/miniguiku \
    --with-style=fashion \
    --disable-galqvfb \
    --disable-qvfbial \
    --disable-static \
    --enable-jz4740ial \
    --enable-galfbcon \
    --enable-fblin16 \
    --disable-micemoveable \
    --disable-cursor \
    --disable-vbfsupport \
    --disable-latin9support \
    --disable-big5support \
    --disable-savebitmap \
    --enable-jpgsupport \
    --enable-pngsupport \
    --disable-imegb2312 \
    --disable-aboutdlg \
    --disable-savescreen \
    --build=i386-linux \
    --host=mipsel-linux \
    --target=mipsel-linux \
    CPPFLAGS=-I/opt/project/uto/minigui/jpegku/include \
    LDFLAGS=-L/opt/project/uto/minigui/jpegku/lib
再make,便可以成功了,接下来make install
其实,prefix最好设置为交叉编译器下,这样在用交叉编译器编译例子的时候就不需要指定.h和minigui lib了,而且还要prefix设为环境变量PATH里,不然例子会找不到.h,或则把.h文件夹拷贝到编译器下,如:
sudo cp -a /opt/project/uto/minigui/miniguiku/include/* /opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux/include/
然后编译例子:
mipsel-linux-gcc listbox.c -o listbox -O2 -Wall -lminigui -lpthread -I/opt/project/uto/minigui/miniguiku/include/minigui -L/opt/project/uto/minigui/miniguiku/lib
-----------------------------------------------------------------------------------------------------------------------------------
接下来定制键盘的ial引擎
①仿照libminigui-1.3.3/src/ial/下的2410,编写4740.h、4740.c,保存至libminigui-1.3.3/src/ial目录下
PS:在libminigui-1.3.3\include\common.h下定义新键盘按键值
如:#define SCANCODE_KEYUP                  130
#define SCANCODE_KEYDOWN                131
#define SCANCODE_KEYLEFT                132
#define SCANCODE_KEYRIGHT               133
#define SCANCODE_KEYENTER               134
#define SCANCODE_MAP      135
#define SCANCODE_GUIDE      136
#define SCANCODE_MAPLONG                  137
②在libminigui-1.3.3/src/ial/ial.c文件中添加新引擎的入口(格式参考其它引擎)
如:
Line99:
#ifdef _JZ4740_IAL
    #include "4740.h"
#endif
Line159:
#ifdef _JZ4740_IAL  
    {"JZ4740", Init4740Input, Term4740Input},
#endif
③在libminigui-1.3.3/下的configure.in、acconfig.h和libminigui-1.3.3/src/ial/Makefile.am文件中加入新引擎的信息:
configure.in中添加:
Line128:build_jz4740_ial_engine="yes"
Line409:
AC_ARG_ENABLE(jz4740,
[ --enable-jz4740     build the input engine for JZ4740 ial ],
build_jz4740_ial_engine=$enableval)
Line1097:
if test "x$build_jz4740_ial_engine" = "xyes"; then
    AC_DEFINE(_JZ4740_IAL)
fi
acconfig.h中添加:
Line373:
/* Define if include IAL engine for jz4740*/
#undef _JZ4740_IAL
在libminigui-1.3.3/src/ial/Makefile.am中添加:
Line39:JZ4740_SRCS = 4740.c 4740.h
Line48:$(JZ4740_SRCS)
④在libminigui-1.3.3/下执行aclocal和autoheader,分别生成aclocal.m4和config.h.in
⑤执行autoconf,生成configure,
⑥执行automake --add-missing命令,生成Makefile.in等文件
⑦./configure \
    --prefix=/opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux \
    --with-style=fashion \
    --disable-galqvfb \
    --disable-qvfbial \
    --disable-static \
    --enable-jz4740ial \
    --enable-galfbcon \
    --enable-fblin16 \
    --disable-micemoveable \
    --disable-cursor \
    --disable-vbfsupport \
    --disable-latin9support \
    --disable-big5support \
    --disable-savebitmap \
    --enable-jpgsupport \
    --enable-pngsupport \
    --disable-imegb2312 \
    --disable-aboutdlg \
    --disable-savescreen \
    --build=i386-linux \
    --host=mipsel-linux \
    --target=mipsel-linux \
    CPPFLAGS=-I/opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux/include \
    LDFLAGS=-L/opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux/lib
⑧make,sudo make install
⑨拷贝/opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux/lib下的minigui库到rootfs/lib下,修改/opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux/etc/MiniGUI.cfg内的ial_engine=jz4740,[fbcon]
defaultmode=320x240-16bpp#根据实际屏幕显示来设置,并将其拷贝到rootfs的/usr/local/etc下
⑩拷贝由minigui-res-1.3.3下编译生成的minigui(默认在/usr/local/lib下)资源到rootfs的/usr/local/lib下
PS:在make时曾出现问题,如下:
出现Warinning:
make
cd . && /bin/bash /opt/project/uto/minigui/libminigui-1.3.3/missing --run aclocal-1.6
/opt/project/uto/minigui/libminigui-1.3.3/missing: line 46: aclocal-1.6: command not found
WARNING: `aclocal-1.6' is missing on your system. You should only need it if
         you modified `acinclude.m4' or `configure.in'. You might want
         to install the `Automake' and `Perl' packages. Grab them from
         any GNU archive site.
cd . && \
          /bin/bash /opt/project/uto/minigui/libminigui-1.3.3/missing --run automake-1.6 --gnu Makefile
/opt/project/uto/minigui/libminigui-1.3.3/missing: line 46: automake-1.6: command not found
WARNING: `automake-1.6' is missing on your system. You should only need it if
         you modified `Makefile.am', `acinclude.m4' or `configure.in'.
         You might want to install the `Automake' and `Perl' packages.
         Grab them from any GNU archive site.
cd . && /bin/bash /opt/project/uto/minigui/libminigui-1.3.3/missing --run autoconf
/opt/project/uto/minigui/libminigui-1.3.3/missing: line 46: autoconf: command not found
WARNING: `autoconf' is missing on your system. You should only need it if
         you modified `configure.in'. You might want to install the
         `Autoconf' and `GNU m4' packages. Grab them from any GNU
         archive site.
/bin/bash ./config.status --recheck
running /bin/bash ./configure --prefix=/opt/project/ToolChain/mipseltools-gcc-4.1.2/mipsel-linux --with-style=fashion --disable-galqvfb --disable-qvfbialisable-static --enable-jz4740ial --enable-galfbcon --enable-fblin16 --disable-micemoveable --disable-cursor --disable-vbfsupport --disable-latin9support -able-big5support --disable-savebitmap --enable-jpgsupport --enable-pngsupport --                                                                          -host=mipsel-linux --target=mipsel-linux CPPFLAGS=-I/opt/project/ToolChain/mipse                                                                          ools-gcc-4.1.2/mipsel-linux/lib build_alias=i386-linux host_alias=mipsel-linux t
checking build system type... i386-pc-linux-gnu
checking host system type... mipsel-unknown-linux-gnu
checking target system type... mipsel-unknown-linux-gnu
checking for mipsel-linux-gcc... mipsel-linux-gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mipsel-linux-gcc accepts -g... yes
checking for mipsel-linux-gcc option to accept ANSI C... none needed
checking for ld used by GCC... ld
解决:安装automake,即sudo apt-get install automake
阅读(1753) | 评论(0) | 转发(0) |
0

上一篇:编译jpeg

下一篇:编译minigui1.3.3 errors

给主人留下些什么吧!~~