如何从linux utils编译* only * uuid

我有 linux utils代码(可以在这里找到: https://www.kernel.org/pub/linux/utils/util-linux/),我只需要libuuid,没有别的.我已经尝试设置了许多’–disable-‘标志,但它似乎仍在编译我不需要的东西.

这是我的实际配置命令:

./configure --disable-libblkid --disable-libmount --disable-mount --disable-losetup --disable-cytune --disable-fsck --disable-partx --disable-uuidd --disable-mountpoint --disable-fallocate --disable-unshare --disable-nsenter --disable-setpriv --disable-eject --disable-agetty --disable-cramfs --disable-bfs --disable-fdformat --disable-hwclock --disable-wdctl --disable-switch_root --disable-pivot_root --disable-kill --disable-last --disable-utmpdump --disable-mesg --disable-raw --disable-rename --disable-login --disable-nologin --disable-sulogin --disable-su --disable-runuser --disable-ul --disable-more --disable-pg --disable-setterm --disable-schedutils --disable-wall --build="$BUILD_ARCH" --host="$HOST_ARCH" --prefix="$outputdir" --exec-prefix="$outputdir"

这是我的输出

<...build things including libuuid...>
  CC       fdisks/cfdisk-cfdisk.o
../fdisks/cfdisk.c: In function 'get_string':
../fdisks/cfdisk.c:447:5: warning: implicit declaration of function 'getyx' [-Wimplicit-function-declaration]
../fdisks/cfdisk.c:447:5: warning: nested extern declaration of 'getyx' [-Wnested-externs]
../fdisks/cfdisk.c:447:11: error: 'stdscr' undeclared (first use in this function)
<...>

有没有办法只建立libuuid?

解决方法

最简单的方法是从你提供的链接提取最新的linux-utils tarball,提取它的内容,然后修改根级Makefile.am.查找看起来像这样的部分:

include tools/Makemodule.am
include include/Makemodule.am
include lib/Makemodule.am
include libuuid/Makemodule.am
include libblkid/Makemodule.am
include libmount/Makemodule.am
include libsmartcols/Makemodule.am
include libfdisk/Makemodule.am

include schedutils/Makemodule.am
include text-utils/Makemodule.am
include term-utils/Makemodule.am
include login-utils/Makemodule.am
include sys-utils/Makemodule.am
include misc-utils/Makemodule.am
include disk-utils/Makemodule.am

include bash-completion/Makemodule.am

include tests/Makemodule.am

修改它看起来像这样(只留下libuuid条目取消注释):

#include tools/Makemodule.am
#include include/Makemodule.am
#include lib/Makemodule.am
include libuuid/Makemodule.am
#include libblkid/Makemodule.am
#include libmount/Makemodule.am
#include libsmartcols/Makemodule.am
#include libfdisk/Makemodule.am
#
#include schedutils/Makemodule.am
#include text-utils/Makemodule.am
#include term-utils/Makemodule.am
#include login-utils/Makemodule.am
#include sys-utils/Makemodule.am
#include misc-utils/Makemodule.am
#include disk-utils/Makemodule.am
#
#include bash-completion/Makemodule.am
#
#include tests/Makemodule.am

最后,从根目录(您提取的存档),执行以下命令:

autoconf
automake
./configure
make

您可能需要运行automake –add-missing而不是automake,并使用autoreconf –force –install而不是autoconf,具体取决于系统上安装的autotools的版本.

现在,只需通过find找到您构建的库. -iname“* libuuid.so *”.

相关文章

/etc/sysctl.conf这个目录主要是配置一些系统信息,/etc/sys...
1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起...
它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅...
不管是我们在安装软件还是监测软件的使用性能,我们都要随时...
装好Tomcat7后,发现除了本机能访问外界访问不了,岂有此理。...
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,...