Zlib移植
来自SylixOS-wiki
(版本间的差异)
(→下载 zlib) |
|||
第9行: | 第9行: | ||
:进入 zlib 目录: | :进入 zlib 目录: | ||
cd zlib | cd zlib | ||
+ | |||
+ | ==configure== | ||
+ | |||
+ | :配置: | ||
+ | ./config --prefix=/lib/zlib | ||
+ | |||
+ | ==修改 Makefile== | ||
+ | :1:(编译好的 SylixOS 与 cextern 目录根据实际情况设置) | ||
+ | # SylixOS PATH | ||
+ | SYLIXOS_PATH=/home/user/sylixos_workspace/libsylixos | ||
+ | CEXTERN_PATH=/home/user/sylixos_workspace/libcextern | ||
+ | :2: | ||
+ | # SYLIXOS includes | ||
+ | INCDIR = $(SYLIXOS_PATH)/SylixOS | ||
+ | INCDIR += $(SYLIXOS_PATH)/SylixOS/include | ||
+ | INCDIR += $(SYLIXOS_PATH)/SylixOS/include/inet | ||
+ | INCDIR += $(SYLIXOS_PATH)/SylixOS/include/inet/ipv4 | ||
+ | INCDIR += $(SYLIXOS_PATH)/SylixOS/include/inet/ipv6 | ||
+ | SHLDIR = $(SYLIXOS_PATH)/Debug | ||
+ | SHLDIR += $(CEXTERN_PATH)/Debug | ||
+ | :3: | ||
+ | # SYLIXOS compile and link options | ||
+ | SYLIXOS_CFLAGS=-DSYLIXOS -DSYLIXOS_LIB $(addprefix -I,$(INCDIR)) -mcpu=arm920t -fmessage-length=0 -fno-short-enums | ||
+ | SYLIXOS_EXLIBS=-nostdlib $(addprefix -L,$(SHLDIR)) -lcextern -lvpmpdm -lm -lgcc | ||
+ | |||
+ | :4: | ||
+ | CC=arm-none-eabi-gcc | ||
+ | |||
+ | :5: | ||
+ | CFLAG = $(SYLIXOS_CFLAGS) $(SYLIXOS_EXLIBS) -shared ...... | ||
+ | SFLAG = $(SYLIXOS_CFLAGS) ...... | ||
+ | |||
+ | :6: | ||
+ | LDSHARED=arm-none-eabi-gcc ...... | ||
+ | CPP=arm-none-eabi-gcc ....... | ||
+ | AR=arm-none-eabi-ar | ||
+ | RANLIB=arm-none-eabi-ranlib | ||
+ | |||
+ | :7: | ||
+ | LDSHAREDLIBC=-shared $(SYLIXOS_EXLIBS) |
2014年7月15日 (二) 23:14的版本
下载 zlib
- 进入 sylixos 工作空间:
cd /home/user/sylixos_workspace
- 下载 zlib:
连接在 http://www.zlib.net/ 页面中
- 进入 zlib 目录:
cd zlib
configure
- 配置:
./config --prefix=/lib/zlib
修改 Makefile
- 1:(编译好的 SylixOS 与 cextern 目录根据实际情况设置)
# SylixOS PATH SYLIXOS_PATH=/home/user/sylixos_workspace/libsylixos CEXTERN_PATH=/home/user/sylixos_workspace/libcextern
- 2:
# SYLIXOS includes INCDIR = $(SYLIXOS_PATH)/SylixOS INCDIR += $(SYLIXOS_PATH)/SylixOS/include INCDIR += $(SYLIXOS_PATH)/SylixOS/include/inet INCDIR += $(SYLIXOS_PATH)/SylixOS/include/inet/ipv4 INCDIR += $(SYLIXOS_PATH)/SylixOS/include/inet/ipv6 SHLDIR = $(SYLIXOS_PATH)/Debug SHLDIR += $(CEXTERN_PATH)/Debug
- 3:
# SYLIXOS compile and link options SYLIXOS_CFLAGS=-DSYLIXOS -DSYLIXOS_LIB $(addprefix -I,$(INCDIR)) -mcpu=arm920t -fmessage-length=0 -fno-short-enums SYLIXOS_EXLIBS=-nostdlib $(addprefix -L,$(SHLDIR)) -lcextern -lvpmpdm -lm -lgcc
- 4:
CC=arm-none-eabi-gcc
- 5:
CFLAG = $(SYLIXOS_CFLAGS) $(SYLIXOS_EXLIBS) -shared ...... SFLAG = $(SYLIXOS_CFLAGS) ......
- 6:
LDSHARED=arm-none-eabi-gcc ...... CPP=arm-none-eabi-gcc ....... AR=arm-none-eabi-ar RANLIB=arm-none-eabi-ranlib
- 7:
LDSHAREDLIBC=-shared $(SYLIXOS_EXLIBS)