Cyber memos for my personal knowledge.

2009-01-08

How to install p7zip 4.61 - UNIX/Linux version of 7-zip on openSUSE 11.1

I install it because I love it...;=)
Again, I'd like to compile it via source code by myself.

BTW, if you are NOT an advanced user I think, you should try the pre-built binary package instead of compiling it by yourself.

Well, if you now stay with M$ Windows I still recommend it. Check it out.

1. Get source code package from here. Currently, latest verson is 4.61.

2. My box is openSUSE 11.1 x86_64, T9500 CPU...;-). So I just un-tar and cd into the directory:
$ cd ./p7zip_4.61/
$ sudo zypper search -d yasm

I got output such as follows:
正在載入套件庫資料...
讀取已安裝的套件...

S | 名稱 | 摘要 | 類型
--+----------+--------------------------------------------------+-----
---| yasm | YASM is a complete rewrite of the NASM assembler | 套件

3. Install yasm:
$ sudo zypper install yasm

I got output such as follows:
正在載入套件庫資料...
讀取已安裝的套件...
正在解決套件相依性...

將會安裝下列新的套件:
yasm


全部下載大小: 240.0 K。 完成操作後,將增加 654.0 K 的使用。
要繼續嗎? [是/否]: y
正在取出 套件 yasm-0.6.2-1.75.x86_64 (1/1), 240.0 K (已解開 654.0 K)
正在取出: yasm-0.6.2-1.75.x86_64.rpm [完成]
正在安裝: yasm-0.6.2-1.75 [完成]

4. Modify ./makefile.machine. Here is my makefile.machine:
$ cp makefile.machine makefile.machine.backup
$ cp makefile.linux_x86_asm_gcc_4.X makefile.machine
$ vim ./makefile.machine

I modify ./makefile.machine as following RED words for my T9500 x86_64 system:
#
# makefile for Linux (x86, PPC, alpha ...)
#

OPTFLAGS=-O

ALLFLAGS=${OPTFLAGS} -m64 -s \
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-DNDEBUG -D_REENTRANT -DENV_UNIX \
$(LOCAL_FLAGS)

CXX=g++ $(ALLFLAGS) -DHAVE_GCCVISIBILITYPATCH -fvisibility=hidden -fvisibility-inlines-hidden
CC=gcc $(ALLFLAGS)
CC_SHARED=-fPIC
LINK_SHARED=-fPIC -shared
ASM=yasm -f elf -m amd64


LOCAL_LIBS=-lpthread
LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl

CPU=x64
OBJ_CRC32=$(OBJ_CRC32_x86_64)

5. Of course, make it!
$ make clean; make all2; sudo ./install.sh
Note that if you need 7zr just replace above "make all2" with "make all3".

Done...;-)

No comments: