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"