A workaround for OPENWRT compilation errors----Installing the XZ tool

Source: Internet
Author: User
Tags memory usage

A problem was encountered when compiling openwrt, as shown in the following figure:


According to the above description, the makefile file is not found in the truck/build_dir/host/patch-2.7.1, actually entering this directory can be found that this directory is empty. The files in this directory should be from TRUNK/DL/PATCH-2.7.1.TAR.XZ, because the system does not have the tools to decompress the XZ format (the installation of XZ is not explained here, it is described in other documents). After installing the XZ tool, you can compile normally, and the following describes the installation steps of the XZ tool.


XZ Utils's official website: http://tukaani.org/xz/

Downloaded a xz-5.0.1.tar.gz source package. Unzip the following as follows:

[root@localhost setup_file]# cd xz-5.0.1
[root@localhost xz-5.0.1]# ls
about-nls   config.h       COPYING           dos              lib          NEWS       tests
aclocal.m4  config.h.in    COPYING. GPLv2     doxyfile         libtool      packagers  THANKS
AUTHORS     config.log COPYING. GPLv3     doxyfile.in      M4           po         TODO
autogen.sh  config.status  COPYING. LGPLv2.1  extra            Makefile     README     windows
build-aux   Configure      Debug             INSTALL          makefile.am  src
ChangeLog   configure.ac   doc               install.generic  Makefile.in  STAMP-H1

There is a readme document, open to view the contents:

156 
157       2. Compile XZ Utils with debugging code using configure switches 158--enable-debug and          , if possible,--disable-share D. If you
is 159          using GCC, use cflags= '-o0-ggdb3 '. Don ' t strip the resulting          binaries.

This place says that if you need to compile code with debugging information, you need to take the--ENABLE-DEBUG option when executing the./configure.

But it's not usually necessary.

And then look down:

166       4. Try to reproduce the suspected bug.  If you get "assertion failed"
167          message, being sure to include the complete message in your bug
168 report          . If the application leaves a coredump, get a backtrace
169          using GDB:            $ gdb/path/to/app-binary   # Load the app to the debugger.
171            (GDB) Core Core   # Open the coredump.
172            (GDB) bt   # Print the backtrace. Copy & Paste to bug report.
173            (GDB) quit   # quit GDB.

This place says that if you encounter an interrupt error while make or do install, you can execute the following command to

Check the cause of the error. General compile time, no error, this step can also be omitted.

And then look down:

191 4. Translating the XZ tool 192--------------------------193 194 The messages from the XZ tool has been translated int o A few 195 languages. Before starting to translate-a new language, ask 196 the author that someone else hasn ' t already started working
On it. 197 198 Test your translation.     Testing includes comparing the translated 199 output to the original 中文版 version by running the same commands 200
In both your target locale and with lc_all=c. Ask someone to 201 proof-read and test the translation. 202 203 testing can be do e.g. by installing XZ into a temporary directory:204 205./configure--disable- 
Shared--prefix=/tmp/xz-test 206 # <edit the. po file in the PO directory.> 207 make-c po Update-po 208 make install 209 Bash Debug/translations.bash | Less Debug/translations.bash Bash | Less-s # for--list outputs

This place is on the point: Compile and install the XZ tool.

1, here refers to a sentence, with the Lc_all area of the relevant issues, in general, this variable does not need to be modified, even if

It does not matter if it is not set to Lc_all=c. In general, the value of this variable is null.

2, compile the first step: Execute the./configure file

./configure--disable-shared--prefix=/tmp/xz-test

This sentence is used to configure the compilation process,--disable-shared means to prohibit sharing,

--prefix=/tmp/xz-test means that the XZ is installed in the/tmp/xz-test directory after compilation.

3, update PO file,

Make-c PO Update-po

The meaning of this command is nothing to explain.-C PO Specifies the search path for makefile, UPDATE-PO indicates that the target is being executed

4. Compiling and installing

Make install

After executing this command, the XZ tool is compiled and installed into the/tmp/xz-test directory.

That's what I did, so the execution of/test/xz-test/bin/xz--help is shown below:

[Root@localhost linux-2.6.32.61]#/tmp/xz-test/bin/xz--help Usage:/tmp/xz-test/bin/xz [OPTION] ...
[FILE] ...

  Compress or decompress FILEs in the. xz format.  -Z,--compress Force compression-d,--decompress Force decompression-t,--test test compressed file
  Integrity-l,--list list information about. XZ Files-k,--keep Keep (don ' t delete) input files -F,--force force overwrite of output file and (DE) compress links-c,--stdout write to standard output a nd don ' t delete input files-0-9 compression preset; Default is 6;
  Take compressor *and* decompressor memory usage to account before using 7-9!
                      -E,--extreme try to improve compression ratio by using the more CPU time; Does not affect decompressor memory requirements-q,--quiet suppress warnings; Specify twice to suppress errors too-v,--verbose is verbose; Specify twice for even MoRe verbose-h,--help Display this short help and exit-h,--long-help display the long help (lists Also The advanced options)-V,--version display the version number and exit with no file, or if file is-, read STA

Ndard input.
Report Bugs to <lasse.collin@tukaani.org> (in 中文版 or Finnish). XZ Utils Home page:  

If you are in trouble, you can add the path:/tmp/xz-test/bin to the environment variable path, or temporarily export it.

-D: Unzip

-Z: Compress files

-T: Test file consistency

-L: List file information

The command executes as follows:

/TMP/XZ-TEST/BIN/XZ-  D  linux-2.6.32.2.xz  

You can unzip your XZ file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.