折腾了半天的ebuild,将记录张贴如下:
ebuild /usr/local/portage/loongson/cross-mips64el-unknown-linux-gnu/gcc/gcc-4.4.2.ebuild help
你就可以看到ebuild能执行的命令了,这里列举几个和安装有关的。
help : show this help screen,帮助信息
setup : execute package specific setup actions,执行设置命令,检测系统环境和系统变量设置以及设置必要的环境变量
fetch : download source archive(s) and patches,在指定的URL下载源码包
unpack : unpack sources (auto-dependencies if needed) 解压源码包
prepare : prepare sources (auto-dependencies if needed)
configure : configure sources (auto-fetch/unpack if needed) 执行configure脚本得到makefile,在gcc的ebuild里,configure和make一起完成了。
compile : compile sources (auto-fetch/unpack/configure if needed) 执行make命令
test : test package (auto-fetch/unpack/configure/compile if needed) 执行make test
install : install the package to the temporary install directory 执行make install,安装到/var下的指定目录
qmerge : merge image into live filesystem, recording files in db 将make install得到的镜像安装到系统中,并升级db
merge : do fetch, unpack, compile, install and qmerge 将上面几步一起完成
unmerge : remove package from live filesystem 相当于emerge -C
config : execute package specific configuration actions
package : create a tarball package in /usr/portage/packages/All 将编译出的二进制文件打包
rpm : build a RedHat RPM package 生成rpm包
clean : clean up all source and temporary files 删除/var/tmp/portage/下编译使用的所有临时文件。
可 见基本上emerge是ebuild分解动作的连续执行,但是有个疑问,ebuild是在何时根据use的配置configure。根据上面的这些命令, 应该是在setup时。在setup的过程中,ebuild会根据当前的系统设置和USE设置,检测系统,并export很多的系统变量。并保存到文件 environment中

Pingback: 《编译点滴》半年记 « 编译点滴