Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1186950
  • 博文数量: 233
  • 博客积分: 6270
  • 博客等级: 准将
  • 技术积分: 1798
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-26 08:32
文章分类

全部博文(233)

文章存档

2011年(31)

2010年(202)

我的朋友

分类: LINUX

2010-07-02 11:44:19

CeGCC Install from source:
Heavily influenced by the CeGCC's build tool chain documentaiton.

This guide is to get the unacquainted to get the sources to CeGCC, build and configure to generate ARM compatible Windows CE executables.

1. Get the sources: (Subversion client must be installed):

svn co  cegcc

2. Run the build script and grab a coffee or what ever is appropriate:
sudo ./build-cegcc.sh

3. Add the path to your bashrc settings:
export PATH=$PATH:/opt/cegcc/bin

4. Test the install with the following file and command:
test.c:
#include 

int WinMain()
{
    printf("Testing\n");
}

Compile line:

arm-wince-cegcc-gcc -o maintest.exe test.c

The only warning that should appear is:

Info: resolving _CRT_MT by linking to __imp__CRT_MT (auto-import)

If there are other errors please check the source file, the CeGCC mailing list, the forum on this or Wiki page.

NOTE: The cegcc carries the same syntax as gcc. For example -I for include directories -l for libraries to include.

5. Notes about CeGCC and SyncE: The CeGCC tool set was made to be used with the SynCE toolset. pcp to copy files to the connected PocketPC, and prun to remotely run an executable on the connected PocketPC device.
6. Sample make file (taken from the example make file provided from the sources (doc/examples/Makefile)

ARCH=        arm-wince-pe
CC=        ${ARCH}-gcc ${CFLAGS}
WINDRES=    ${ARCH}-windres

CFLAGS=        -D_WIN32_IE=0x0400 ${VERBOSE} ${INCLUDE}
LDFLAGS=    -Wl,--major-subsystem-version,4,--minor-subsystem-version,20
PDADIR=        ":/storage card/devel"

menu-resource.exe:    menu-resource.o menu-resource.rsc
    ${CC} -o $@ menu-resource.o menu-resource.rsc -lcommctrl ${LDFLAGS}

menu-resource.o:    menu-resource.c
    ${CC} -c $?

menu-resource.rsc:    menu-resource.rc menu-resource.h
    ${WINDRES} menu-resource.rc menu-resource.rsc

clean:
    -rm -f *.o *.exe *.rsc

dist:
    for i in *.exe ; do \
        pcp $$i ${PDADIR}/$$i ; \
    done
阅读(1025) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~