|
楼主 |
发表于 2005-1-23 12:28:16
|
显示全部楼层
编译过程
0.安装gtk-for-cygwin
gtk2-win32-2.2.1-3.tar.gz
gtkmm-win32-2.2.0-1.tar.gz
atk-1.2.0-1.tar.gz
pango-1.2.1-2.tar.gz
glib-2.2.1-2.tar.gz
1. run configure scripts
./configure --target=arm-elf --prefix=/usr/local --without-gtk-prefix --without-gtk-exec-prefix --disable-gtktest
2. make
a. skyeye_lcd.c 不能编译,原因找不到gtk/gtk.h,gdk/gdk.h,glib.h,pango/pango.h,glib-object.h,gdkconfig.h
b. copy glibconfig.h from \usr\lib\glib-2.0\include to skyeye/sim/arm
c. gcc -c skyeye_lcd.c -o skyeye_lcd.o -DHAVE_CONFIG_H -DDEFAULT_INLINE=0 -DMODET -I. -I. -I../common -I./../common -I../../include -I./../../include -I../../bfd -I./../../bfd -I../../opcodes -I./../../opcodes -I../../intl -I./../../intl -I../../include/gdb -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/include/pango-1.0 -I/usr/lib/glib-2.0/include -I/usr/include/atk-1.0 -g -O2
3.skyeye-ne2k.c不能编译,原因找不到linux/if_tun.h
注释skyeye-ne2k.c全部代码,创建skyeye_stub.c文件,修改 makefile 编译skyeye_stub.c.
skyeye_stub.c内容如下
/***************************************************/
unsigned long Pen_buffer[8];
void nic_init(void)
{
}
int tapif_init(int index,unsigned char *macaddr, unsigned char *hostip)
{
}
void tapif_input(int tapif_fd, ARMul_State *state)
{
}
INT8U tapif_output(int tapif_fd, ARMul_State *state,INT8U startpage,INT16U packet_len)
{
}
INT8U nic_read(int nic_index, ARMul_State *state, INT8U offset)
{
}
void nic_write(int nic_index, ARMul_State *state,INT8U offset, INT8U data) //offset should be 00-0f, 10 or 1f
{
}
int vnetif_init(int index,unsigned char *macaddr, unsigned char *hostip)
{
}
4.添加如下代码在下列文件skyeye_mach_at91.c,skyeye_mach_at91rm92.c,skyeye_mach_cs89712.c,...
的 #include "skyeye-ne2k.h" 行后,添加
//zzc:2005-1-1
#include "mpw/sys/time.h"
5.注释skyeye_net_tuntap.c,skyeye_net_vnet.c文件全部内容
6.如上修改源代码后,在link时,还会报告一些link error
在sim/arm目录下,出错时,使用:
gcc -DHAVE_CONFIG_H -DDEFAULT_INLINE=0 -DMODET `pkg-config gtk+-2.0 --cflags` -I. -I. -I../common -I./../common -I../../include -I./../../include -I../../bfd -I./../../bfd -I../../opcodes -I./../../opcodes -I../../intl -I./../../intl -I../../include/gdb -g -O2 -o run.exe run.o libsim.a ../../bfd/libbfd.a ../../opcodes/libopcodes.a ../../intl/libintl.a ../../libiberty/libiberty.a /usr/lib/libgtk-win32-2.0.dll.a /usr/lib/libatkmm-1.0.dll.a /usr/lib/libgtkmm-2.0.dll.a /usr/lib/libgdk-win32-2.0.dll.a /usr/lib/libgtkmm_generate_extra_defs-2.0.dll.a /usr/lib/libgdk_pixbuf-2.0.dll.a /usr/lib/libpangomm-1.0.dll.a /usr/lib/libgdkmm-2.0.dll.a /usr/lib/libglibmm-2.0.dll.a /usr/lib/libglib-2.0.dll.a /usr/lib/libgobject-2.0.dll.a /usr/lib/libgmodule-2.0.dll.a /usr/lib/libgthread-2.0.dll.a libsim.a
在gdb目录下,出错时,使用:
gcc -g -O2 -Wl,-Map -Wl,map.txt -o gdb.exe gdb.o main.o cli-dump.o cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o mi-out.o mi-console.o mi-cmds.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o mi-cmd-disas.o mi-main.o mi-parse.o mi-getopt.o libgdb.a rdi-share/libangsd.a `pkg-config --libs gtk+-2.0 ` ../sim/arm/libsim.a ../bfd/libbfd.a ../readline/libreadline.a ../opcodes/libopcodes.a ./../intl/libintl.a ../libiberty/libiberty.a `if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi` -lm ../libiberty/libiberty.a -luser32 `pkg-config --cflags gtk+-2.0 ` -L/usr/lib libgtk-win32-2.0.dll.a libatkmm-1.0.dll.a libgtkmm-2.0.dll.a libgdk-win32-2.0.dll.a libgtkmm_generate_extra_defs-2.0.dll.a libgdk_pixbuf-2.0.dll.a libpangomm-1.0.dll.a libgdkmm-2.0.dll.a libglibmm-2.0.dll.a libglib-2.0.dll.a libgobject-2.0.dll.a libgmodule-2.0.dll.a libgthread-2.0.dll.a |
|