Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile *only* uuid from linux utils

I have the linux utils code (can be found here: https://www.kernel.org/pub/linux/utils/util-linux/) and I only need libuuid, nothing else. I've tried setting many '--disable-' flags but it still seems to be compiling things I don't need.

Here's my actual configure command:

./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" 

and here's my output:

<...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)
<...>

Is there any way to only build libuuid?

like image 418
s g Avatar asked Mar 12 '14 17:03

s g


3 Answers

I was able to build just libuuid with these parameters:

--disable-all-programs --enable-libuuid
like image 162
ChrisSH Avatar answered Oct 21 '22 08:10

ChrisSH


The easiest approach would be to pull the latest linux-utils tarball from the link you provided, extract it's contents, and then modify the root-level Makefile.am. Look for the section that looks like this:


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

And modify it to look like so (leave only the libuuid entry uncommented):

#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

Finally, from the root directory (of the archive you extracted), execute the following:

autoconf
automake
./configure
make

You may need to run automake --add-missing instead of automake, and autoreconf --force --install instead of autoconf, depending on the version of autotools installed on your system.

Now, just find your built library via find . -iname "*libuuid.so*".

like image 2
Cloud Avatar answered Oct 21 '22 09:10

Cloud


you could get the code from https://sourceforge.net/projects/libuuid/ and compile it. This should only build libuuid ....

like image 1
Basile Starynkevitch Avatar answered Oct 21 '22 09:10

Basile Starynkevitch