--enable-shared=no --enable-static=yes (静态)
--enable-shared=yes --enable-static=no (动态)
如果不做任何设置,则动态库与静态库同时生成
例子
./configure CC=amr-linu-gcc --target=arm-linux --host=arm-linux-gcc --prefix=/usr/local/iconv --enable-shared --enable-static
config.log中会有类似这样的语句
configure:14433: checking whether to build shared libraries
configure:14458: result: yes
configure:14461: checking whether to build static libraries
configure:14465: result: no
./configure --help中有一段话,说明默认是动态库和静态都要构建的。
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
本文介绍了在构建软件时如何使用--enable-shared和--enable-static选项来选择生成动态库或静态库。默认情况下,两者都会被构建。动态库(--enable-shared=yes)用于节省磁盘空间和内存,而静态库(--enable-static=yes)则提供独立运行的可执行文件。了解这些选项对于系统管理员和开发者优化软件部署至关重要。
2654

被折叠的 条评论
为什么被折叠?



