Linuxconfigure cross-compilation parameter settings

Source: Internet
Author: User
Linuxconfigure for cross-compilation parameter settings-general Linux technology-Linux programming and kernel information, the following is a detailed description. Today, we need to perform cross-compilation on a set of programs. This program comes with configure.

At first, I wanted to use a clumsy method to modify Makefile one by one.

Later, Liu Bo reminded me to study configure settings.

Google has some of the following experiences

Configure has many parameters, including the following:

-- Srcdir = DIR
This option does not work for installation. It will tell the location of the 'configure 'source code. Generally, this option is not required because the 'configure' script is usually in the same directory as the source code file.

-- Program-prefix = PREFIX
Specifies the prefix that will be added to the name of the installed program. for example, if you use '-- program-prefix = G' to configure a program named 'tar', the installed program will be named 'gtar '. this option is used only when it is used with other installation options. in 'file used only.

-- Program-suffix = SUFFIX
Specifies the suffix that will be added to the name of the installed program.

-- Program-transform-name = PROGRAM
The PROGRAM here is a sed script. When a PROGRAM is installed, its name will go through 'sed-e PROGRAM 'to generate the installation name.

-- Build = BUILD
The system platform where the software package is installed. If not specified, the default value is the value of the '-- host' option.

-- Host = HOST
The system platform where the software runs. If this parameter is not specified, 'config. guess 'is run to detect the platform.

-- Target = GARGET
Specify the target to system platform of the software. This mainly plays a role in the context of programming language tools such as compilers and compilers. If not specified, the value of the '-- host' option is used by default.

-- Disable-FEATURE
Some software packages can choose this option to provide compilation configuration for large options, such as using the Kerberos authentication system or an experimental compiler optimal configuration. if these features are provided by default, you can use '-- disable-FEATURE' to disable them. Here 'feature 'is the name of the FEATURE. for example:

$./Configure -- disable-gui

-Enable-FEATURE [= ARG]
On the contrary, some software packages may provide some features that are disabled by default. You can use '-- enable-FEATURE' to use it. here, 'feature 'is the FEATURE name. A feature may accept an optional parameter. for example:

$./Configure -- enable-buffers = 128

'-- Enable-FEATURE = no' is synonymous with' -- disable-FEATURE 'mentioned above.

-- With-PACKAGE [= ARG]

In the free software community, there are excellent traditions of using existing software packages and libraries. when you use 'configure 'to configure a source code tree, you can provide information about other installed software packages. for example, the BLT device toolkit relies on Tcl and Tk. to configure the BLT, you may need to provide the 'configure 'with some information about where we installed the Tcl and Tk:

$./Configure -- with-tcl =/usr/local -- with-tk =/usr/local

'-- With-PACKAGE = no' is synonymous with' -- without-PACKAGE.

-- Without-PACKAGE
Sometimes you may not want your software package to interact with the existing software package of the system. For example, you may not want your new compiler to use GNU ld. You can do this by using this option:

$./Configure -- without-gnu-ld

-- X-regiondes = DIR
This option is a special case of the '-- with-package' option. when Autoconf was initially developed, it was popular to use 'configure 'as a work und for Imake to create software running on X. the '-- x-uploads' option specifies the directory containing the X11 header file to the 'configure' script.

-- X-libraries = DIR
Similarly, the '-- x-libraries' option provides a method for specifying the directory containing the X11 Library to the 'configure' script.

======================================

Red highlight is the focus of our cross-compilation application.

Configure -- host = arm-linux. This is the cross-compilation option of arm.
Configure -- host = mipsel-linux. This is the cross-compilation option of mipsel.

======================================

Next I will turn to a blog that is helpful to me.
During cross-compilation, configure -- host = arm-linux is always used. However, many test programs in CONFIGURE cannot be run on the HOST. The following error occurs: cannot run test program while cross compiling
For similar errors, you can use CACHEFILE to solve this problem. Thank you for your guidance from ABSURD.
I am the first step to solve this problem: Record errors such as: checking abstract socket namespace... configure: error: cannot run test program while cross compiling
Note that abstract socket namespace searches abstract socket in configure and you can see a structure similar to this.
Echo "$ as_me: $ LINENO: checking abstract socket namespace"> & 5
Echo $ ECHO_N "checking abstract socket namespace... $ ECHO_C"> & 6
If test "$ {ac_cv_have_effecact_sockets + set}" = set; then
Echo $ ECHO_N "(cached) $ ECHO_C"> & 6
Ac_cv_have_abstract_sockets is the variable to be searched.
Use echo ac_cv_have_effecact_sockets = yes> arm-linux.cache
Then
./Configure -- host = arm-linux -- cache-file = arm-linux.cache
K.

In addition:
1: Disable GUI in/sbin/init 3 of fedora

Some configure depends on lib compilation and must be supported by pkg-config.

You need to set the PKG_CONFIG_PATH environment variable, which points to the xxx. pc of the dependent lib.

Description file: describes the features of lib in xxx. pc, as shown in figure

Prefix =/develop/upnp/mis_libupnp
Exec_prefix =$ {prefix}
Libdir =$ {exec_prefix}/lib
Includedir =/develop/upnp/mis_libupnp/include

Name: libupnp
Description: Linux SDK for UPnP Devices
Version: 1.6.3
Ibs:-L $ {libdir}-lupnp-lthreadutil-lixml
Cflags:-pthread-I $ {includedir}/upnp

2: The configure script uses the C file compilation method to determine whether lib exists.

You can pass the test by modifying the configure file, specifically adding-I or-L to specify the location.

Some specify the target platform through -- host, -- host = mipsel-linux (libupnp)

Some parameters are specified through -- cross-prefix = mipsel-linux--- cross-compile (ushare,

For details, see configure -- help/-h.
Related Article

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.