移植 unzip 工具

原创 2016年08月31日 12:06:50
项目上要使用ZIP格式的压缩包,但是busybox自带的unzip工具不支持,移植了标准的unzip工具。
1.下载地址是:
http://sourceforge.net/projects/infozip/files/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz/download
2.在察看根目录下的文件,configure Makefile 文件。有一个INSTALL文件,打开:
root@wang:/work/3716C/release/tools/unzip# head INSTALL -n 40
__________________________________________________________________________

  This is the Info-ZIP file INSTALL (for UnZip), last updated 16 Apr 2009.
__________________________________________________________________________

  Yes, this is a rather long file, but don't be intimidated:  much of its
  length is due to coverage of multiple operating systems and of optional
  customization features, large portions of which may be skipped.
__________________________________________________________________________
To compile UnZip, UnZipSFX and/or fUnZip (quick-start instructions):
========================================

(1) Unpack everything into a work directory somewhere, and make sure you're
    in the main UnZip directory (the one with this file in it).
    * (See note below concerning line termination format used in the source
       distribution)

(2) Copy the appropriate makefile into the current directory, except under
    OS/2.

(3) Run your "make" utility on the makefile (e.g., "nmake -f makefile.msc").

(4) Try out your new UnZip the way you would any new utility:  read the
    docs first.

    Ah ha ha ha!!  Oh, that kills me.  But seriously...  For VMS, see the
    Install section below or [.vms]README. for details.

    For DOS and other OSes without explicit timezone support (i.e., everybody
    but Unix, Windows 95 and NT), make sure the "TZ" environment variable is
    set to a valid and reasonable value; see your compiler docs for details.

(*) The unzip sources as well as other Info-ZIP source archives are packaged
    in Unix format. All text files use single LF (Ascii 0x0a) characters as
    line terminators.  On systems that use different conventions for plain text
    files (e.g.:DOS,Win9x,WinNT,OS/2 -> combined CR+LF; MacOS -> single CR),
    some utilities (editors, compilers, etc.) may not accept source files
3. 有编译说明,就按照步骤来。
root@wang:/work/b500_hi3716/release/tools/unzip60# cd unix/
root@wang:/work/b500_hi3716/release/tools/unzip60/unix# ls
configure  Contents  Makefile  Packaging  unix.c  unxcfg.h  zipgrep

root@wang:/work/b500_hi3716/release/tools/unzip60# cp unix/Makefile  . ./
修改Makefile ,使用工具链:
# UnZip flags
CC = cc# try using "gcc" target rather than changing this (CC and LD
LD = $(CC)# must match, else "unresolved symbol:  ___main" is possible)
AS = as
LOC = $(D_USE_BZ2) $(LOCAL_UNZIP)
AF = $(LOC)
CFLAGS = -O


# UnZip flags
CC = arm-hisiv200-linux-cc# try using "gcc" target rather than changing this (CC and LD
LD = $(CC)# must match, else "unresolved symbol:  ___main" is possible)
AS = arm-hisiv200-linux-as
LOC = $(D_USE_BZ2) $(LOCAL_UNZIP)
AF = $(LOC)
CFLAGS = -O


4。编译
root@wang:/work/b500_hi3716/release/tools/unzip60# make

  If you're not sure about the characteristics of your system, try typing
  "make generic".  This is new and uses the configure script, though it is
  still being worked on.

  If that does not do it, try the original generic which is "make generic1".

  If the compiler barfs and says something unpleasant about "timezone redefined",
  try typing "make clean" followed by "make generic2".  If, on the other
  hand, it complains about an undefined symbol _ftime, try typing "make clean"
  followed by "make generic3".

  One of these actions should produce a working copy of unzip on most Unix
  systems.  If you know a bit more about the machine on which you work, you
  might try "make list" for a list of the specific systems supported herein.
  (Many of them do exactly the same thing, so don't agonize too much over
  which to pick if two or more sound equally likely.)  Also check out the
  INSTALL file for notes on compiling various targets.  As a last resort,
  feel free to read the numerous comments within the Makefile itself.

  Have a mostly pretty good day.

直接make有错误,看说明:
root@wang:/work/b500_hi3716/release/tools/unzip60# make generic
OK

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(1182) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
版权声明:本文为博主原创文章,转载请注明出处。

linux unzip下载与安装

下载地址:http://linux.softpedia.com/progDownload/UnZip-Download-389.html
  • wind00sky
  • wind00sky
  • 2009年04月28日 16:28
  • 11213

Ubuntu 解压缩工具安装

Ubuntu 解压缩工具安装 sudo apt-get install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudevi...
  • weiyouyin
  • weiyouyin
  • 2011年11月07日 21:47
  • 5164

GZIP数据压缩/解压工具

GZIP概念 GZIP最早由Jean-loup Gailly和Mark Adler创建,用于UNⅨ系统的文件压缩。我们在Linux中经常会用到后缀为.gz的文件,它们就是GZIP格式的。现今已经成为I...
  • dslnf
  • dslnf
  • 2017年07月26日 14:16
  • 140

MySQL表与数据向Oracle移植(使用Oracle SQL Developer工具)

今天接到一个任务,让我把MySQL中的表与数据移植到Oracle中(也就是我们的项目需要使用Oracle),本来打算一个表一个表的改的(很傻很天真),结果发现,光sql语句就有40多兆!从网上找了好久...
  • u012814041
  • u012814041
  • 2013年12月24日 21:43
  • 17119

UnZip解压缩并删除原文件。

//UnZip     [labelOfBlocker setText:NSLocalizedString(@"TXT_UNZIPPING", nil)];     NSString *fil...
  • zhh107
  • zhh107
  • 2012年03月14日 15:09
  • 768

unzip命令强制覆盖

Reffered : https://zhidao.baidu.com/question/2078530382280285868.html-o 不必先询问用户,unzip执行后覆盖原有文件。Mik...
  • Love_Legain
  • Love_Legain
  • 2017年11月30日 10:02
  • 392

ftp客户端移植(基于netkit-ftp-0.17.tar.gz)

使用busybox制作的根文件系统,没有ftp客户端工具,无法登录到其他的ftp服务器,需要自己编译ftp指令。 在这里采用源码包netkit-ftp-0.17.tar.gz编译,步骤如下: 1、...
  • u014650722
  • u014650722
  • 2016年05月24日 18:52
  • 1770

Linux下unzip解压windows压缩的zip件,中文名乱码问题

参考 http://www.111cn.net/sys/linux/72590.htm 方法1: unzip -O CP936 xxx.zip (GBK, GB18030) 方法2: jar xvf ...
  • lzx1104
  • lzx1104
  • 2015年07月19日 12:58
  • 1141

unzip 解决中文乱码的问题

在项目开发过程中使用了ZIP UTILS 进行文件的压缩和解压缩 但在解压含有中文文件名称的zip压缩包时,解压的文件名出现乱码的情况 再网上搜索解决方案如下:      zip.c...
  • w18mc0431
  • w18mc0431
  • 2018年01月12日 21:28
  • 37

Linux下使用unzip解压缩中文乱码问题

问题提出使用info-zip.org 的 unzip类 解压zip压缩包,如果压缩包中有中文文件名,那么解压这些文件出来时文件名是乱码的。 分析:参考这篇文章 让Unzip正确解压其中包含中文文件名...
  • gatieme
  • gatieme
  • 2015年04月01日 15:07
  • 19949
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:移植 unzip 工具
举报原因:
原因补充:

(最多只允许输入30个字)