Cross-compiling scenario analysis (ARM-Linux) (8)-compiling glib

Source: Internet
Author: User

Cross-compilation scenario analysis (ARM-Linux) (8) -- compile glib

 

Please indicate the source when reprint: http://blog.csdn.net/absurd

 

1.Basic information:

Software name

Glib

Function Description

Glib is a basic gnome library that provides basic containers, algorithms, object systems, osapi adapters, and so on.

Http://www.gtk.org

Software Version

Glib-2.8.0.tar.gz

Dependency

Default

Prerequisites

Source File: $(work_dir)/glib-2.8.0

 

2.Process Analysis

For the stable version to be downloaded, configure already exists and you can directly configure it:

[Root @ Linux glib-2.8.0] #./configure -- Host = $ arch-Linux -- prefix = $ rootfs_dir/usr

The following error occurs:

Checking for growing stack pointer... configure: Error: cannot run test program while cross compiling

 

Configure cannot check glib_cv_stack_grows for cross-compilation. glib_cv_stack_grows indicates the growth direction of the stack. Configure could not run the test program on the target machine, and it could not be checked, so it had to be manually specified. By the way, check which other variables cannot be checked. Write them to the cache file and reconfigure them:

[Root @ Linux glib-2.8.0] # echo ac_cv_type_long_long = Yes> $ ARCH-linux.cache

[Root @ Linux glib-2.8.0] # echo glib_cv_stack_grows = NO> $ ARCH-linux.cache

[Root @ Linux glib-2.8.0] # echo glib_cv_uscore = NO> $ ARCH-linux.cache

[Root @ Linux glib-2.8.0] # echo ac_cv_func_posix_getpwuid_r = Yes> $ ARCH-linux.cache

[Root @ Linux glib-2.8.0] #./configure -- Host = $ arch-Linux -- prefix = $ rootfs_dir/usr -- cache-file = $ ARCH-linux.cache

 

This configuration is successful. Compile:

[Root @ Linux glib-2.8.0] # Make & make install

 

Compiled successfully!

 

3.Build prescription

L glib. mk

Glib_dir = "glib- 2.8.0"

 

ALL: Clean config build

 

Config:

@ CD $ (glib_dir )&&/

Echo ac_cv_type_long_long = Yes> $ ARCH-linux.cache &&/

Echo glib_cv_stack_grows = No >$ $ ARCH-linux.cache &&/

Echo glib_cv_uscore = No >$ $ ARCH-linux.cache &&/

Echo ac_cv_func_posix_getpwuid_r = Yes >>$ $ ARCH-linux.cache &&/

./Configure -- Host =$ $ arch-Linux -- prefix =$ $ rootfs_dir/usr -- cache-file =$ $ ARCH-linux.cache &&/

Echo "Config done"

Build:

@ CD $ (glib_dir )&&/

Make & make install &&/

Echo "build done"

Clean:

@ CD $ (glib_dir )&&/

If [-e makefile]; then make distclean; fi &&/

Echo "clean done"

 

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.