|
发表于 2004-6-15 23:10:46
|
显示全部楼层
我不小心找到一个,是chen yu大侠写的,对此表示十分感谢
File: [GRO-CVS] / skyeye / skyeye_gdb_v5.0 / buildskyeyeoncygwin.txt (download)
Revision 1.1.1.1 (vendor branch), Sat May 17 05:00:09 2003 UTC (13 months ago) by chenyu
Branch: chenyu, MAIN
CVS Tags: ver_0_2_6, REL_0_2_7, REL_0_2_6, HEAD
Changes since 1.1: +0 -0 lines
0.2.6 version
--------------------------------------------------------------------------------
Howto Build skyeye on cygwin
Chen Yu <[email protected]>
2002-12-19
This method has been tested in cygwin 1.3.10, cygwin1.3.12, cygwin1.3.17 environment
1. Install cygwin 1.3.10 + in windows2000/xp, must install gcc and some related packages (don't need XFree86 packages).
These packages are in devel subtree of cygwin.
2. Download skyeye package and copy it to /home/Administrator/ (in cygwin environment),
unpack skyeye package.
cd /home/Administrator/
tar jxvf skyeye-0.1.src.tar.bz2
Now the all armulator source codes are in /home/Administrator/skyeye/
3. copy some missing files to gdb source directory.
gdb missing two endian.h files. We copy RedHat7.2 's include files
first build /usr/include/bits directory
mkdir /usr/include/bits
then copy files,
from linux's files
/usr/include/bits/endian.h
/usr/include/endian.h
to cygwin's files
/usr/include/bits/endian.h
/usr/include/endian.h
we should copy some cygwin's include files to gdb
if we use cygwin 1.3.10
cp /usr/include/mingw/wctype.h /home/Administrator/skyeye/gdb/
cp /usr/include/mingw/_mingw.h /home/Administrator/skeeye/gdb/
if we use cygwin 1.3.12 +
cp /usr/include/mingw32/wctype.h /home/Administrator/skyeye/gdb/
cp /usr/include/mingw32/_mingw.h /home/Administrator/skyeye/gdb/
4. configure gdb
if there isn't /usr/local/bin/gtk-config.exe file in cygwin environment, do below commands
touch /usr/local/bin/gtk-config
touch /usr/local/bin/gtk-config.exe
chmod 755 /usr/local/bin/gtk-config /usr/local/bin/gtk-config.exe
else we do nothing.
After we did these things, do below commands
cd /home/Administrator/skyeye/
./configure --target=arm-elf --prefix=/usr/local --without-gtk-prefix --without-gtk-exec-prefix --disable-gtktest
if there isn't /usr/local/bin/gtk-config.exe file in cygwin environment, do below commands
rm -f /usr/local/bin/gtk-config /usr/local/bin/gtk-config.exe
else we do nothing.
5. Change some gdb files.
---------------------------------------------------------------------------------------------------
If we use cygwin 1.3.12 +, then do nothing, but if we use cygwin1.3.10, then we should do someting,
Change /home/Administrator/skyeye/sim/arm/Makefile, find string 'CONFIG_LIBS = -lnsl'
from
CONFIG_LIBS = -lnsl
to
CONFIG_LIBS = -lintl
Change /home/Administrator/skyeye/gdb/Makefile, find string 'WIN32LIBS ='
from
WIN32LIBS =
to
WIN32LIBS = -lintl /usr/lib/libiberty.a /usr/lib/mingw/libcrtdll.a /usr/lib/w32api/libmsvcp60.a
If we use cygwin1.3.10, we should do :
Change files
/home/Administrator/skyeye/sim/arm/Makefile
/home/Administrator/skyeye/gdb/Makefile
/home/Administrator/skyeye/gdb/rdi-share/Makefile
/home/Administrator/skyeye/bfd/doc/Makefile
/home/Administrator/skyeye/bfd/Makefile
/home/Administrator/skyeye/opcode/Makefile
from
EXEEXT =
to
EXEEXT = .exe
--------------------------------------------------------------------------------------------------
We should below things in cygwin 1.3.10 or 1.3.12+ :
Change skyeye/gdb/rdi-share/Makfile, find string '$(AR) cru libangsd.a $(libangsd_a_OBJECTS) $(libangsd_a_LIBADD)'
from
$(AR) cru libangsd.a $(libangsd_a_OBJECTS) $(libangsd_a_LIBADD)
to
$(AR) q libangsd.a $(libangsd_a_OBJECTS) $(libangsd_a_LIBADD)
Change /home/Administrator/skyeye/gdb/utils.c, find '#include <term.h>'
from
#include <term.h>
to
#include <ncurses/term.h>
Change /home/Administrator/skyeye/sim/arm/armlcd.c, the source code is below:
-----------------------------------------------------------------------------------
/*
armlcd.c - LCD display emulation in an X window.
ARMulator extensions for the ARM7100 family.
Copyright (C) 1999 Ben Williamson
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <assert.h>
/* chy change 2002-12-3
#include <gtk/gtk.h>
*/
#include "armdefs.h"
#define MAX_DEPTH 4 /* bits per pixel */
#define GREY_LEVELS 16
#define LCD_BASE 0xC0000000
/*chy change 2002-12-3*/
#define NO_LCD
#ifdef NO_LCD
void lcd_enable(ARMul_State *state, int width, int height, int depth){};
void lcd_disable(ARMul_State *state) {};
void lcd_write(ARMul_State *state, ARMword addr, ARMword data){};
void lcd_cycle(ARMul_State *state){};
void lcd_dirty(ARMul_State *state, ARMword addr){};
void lcd_clean(ARMul_State *state){};
#else
static GtkWidget *window;
static GdkGC *gc[GREY_LEVELS];
static int no_X = 0;
static int lcd_width, lcd_height, lcd_depth;
static int lcd_palette[GREY_LEVELS] = {0, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
static gint
expose_event (GtkWidget *widget, GdkEventExpose *event)
{
/* event->area.x, event->area.y, event->area.width, event->area.height */
return FALSE;
}
static gint
button_press_event (GtkWidget *widget, GdkEventButton *event)
{
/* event->x, event->y, event->button */
return TRUE;
}
static gint
motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
{
/* event->x, event->y */
return TRUE;
}
extern int global_argc;
extern char **global_argv;
void
lcd_cycle(ARMul_State *state)
{
gtk_main_iteration_do(FALSE);
}
void
lcd_enable(ARMul_State *state, int width, int height, int depth)
{
int i;
static int once = 0;
GdkColormap *colormap;
if (getenv("DISPLAY") == NULL) {
no_X++;
return;
}
if (!once) {
once++;
gtk_init(&global_argc, &global_argv);
}
lcd_width = width;
lcd_height = height;
lcd_depth = depth;
state->io.lcd_limit = LCD_BASE + (width * height * depth / ;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name(window, "DXTree");
gtk_widget_set_usize(window, width, height);
gtk_signal_connect(GTK_OBJECT(window), "expose_event",
(GtkSignalFunc)expose_event, NULL);
gtk_signal_connect(GTK_OBJECT(window), "motion_notify_event",
(GtkSignalFunc)motion_notify_event, NULL);
gtk_signal_connect(GTK_OBJECT(window), "button_press_event",
(GtkSignalFunc)button_press_event, NULL);
gtk_widget_set_events(window, GDK_EXPOSURE_MASK
| GDK_LEAVE_NOTIFY_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_MASK);
gtk_widget_show(window);
colormap = gdk_window_get_colormap(window->window);
for (i = 0; i < GREY_LEVELS; i++) {
GdkColor color;
/* #7fc5a7 is a nice LCDish colour */
color.red = (15 - i) * (0x7f00 / GREY_LEVELS);
color.green = (15 - i) * (0xc500 / GREY_LEVELS);
color.blue = (15 - i) * (0xa700 / GREY_LEVELS);
gdk_color_alloc (colormap, &color);
gc = gdk_gc_new(window->window);
gdk_gc_set_foreground(gc, &color);
}
}
void
lcd_disable(ARMul_State *state)
{
int i;
if (no_X)
return;
for (i = 0; i < GREY_LEVELS; i++) {
if (gc) {
gdk_gc_destroy(gc);
gc = NULL;
}
}
if (window) {
gtk_widget_destroy(window);
window = NULL;
}
}
void
lcd_write(ARMul_State *state, ARMword addr, ARMword data)
{
ARMword offset;
int pixnum, x, y, bit;
if (no_X)
return;
offset = (addr & ~3) - LCD_BASE;
pixnum = offset * 8 / lcd_depth;
x = pixnum % lcd_width;
y = pixnum / lcd_width;
assert(y < lcd_height);
for (bit = 0; bit < 32; bit += lcd_depth) {
/* XXX need palette code here */
int pix = (data >> bit) % (1 << lcd_depth);
gdk_draw_point(window->window, gc[lcd_palette[pix]], x, y);
x++;
}
}
#endif
---------------------------------------------------------------------------------------------
6. now build gdb, do below commands:
cd /home/Administrator/skyeye/
./make
./make install
strip /usr/local/bin/arm-elf-gdb.exe /usr/local/bin/arm-elf-run.exe
Now, armulator should be OK! |
|