From d1c07faf5b5979c19c4709f7195c612fb0a9dd2e Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Fri, 1 Aug 2014 11:55:45 +0800 Subject: [PATCH] autotools: Don't link udev into everything By default, AC_CHECK_LIB will append to $LIBS, which is used for all link stages. Intstead, we should popuate $UDEV_LIBS, and just use that for the single pb-discover link stage. Signed-off-by: Jeremy Kerr --- configure.ac | 4 ++-- discover/Makefile.am | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index fbb6520..9511fef 100644 --- a/configure.ac +++ b/configure.ac @@ -51,7 +51,7 @@ if test "x$ax_cv_curses" = xyes; then fi AC_CHECK_LIB([udev], [udev_new], - [], + [UDEV_LIBS=-ludev], [AC_MSG_FAILURE([The libudev development library is required by petitboot. Try installing the package libudev-dev or libudev-devel.])] ) @@ -257,7 +257,7 @@ AS_IF( ] ) - +AC_SUBST([UDEV_LIBS]) AC_SUBST([LIBTOOL_DEPS]) AC_SUBST([DESTDIR]) AC_SUBST([pkgsysconfdir], ["${sysconfdir}/${package}"]) diff --git a/discover/Makefile.am b/discover/Makefile.am index 9e922fe..0dc5e89 100644 --- a/discover/Makefile.am +++ b/discover/Makefile.am @@ -57,10 +57,9 @@ discover_pb_discover_SOURCES = \ discover/pxe-parser.c discover_pb_discover_LDADD = \ + discover/grub2/grub2-parser.ro \ $(core_lib) \ - discover/grub2/grub2-parser.ro - -discover_pb_discover_LDFLAGS = -ludev + $(UDEV_LIBS) discover_pb_discover_CPPFLAGS = \ $(AM_CPPFLAGS) \ -- 2.39.2