From eb6af031ec83c4c0c1d7e12d1cc8f585197c025f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 4 May 2010 23:42:01 -0500 Subject: Build vercmp without needing link to libalpm Include the object file directly from the libalpm version comparison code as it is the only thing we need. This drops the dependency of vercmp on libalpm and all of the stuff we know it drags in. Signed-off-by: Dan McGee --- src/util/Makefile.am | 2 +- src/util/vercmp.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 638e2764..7dce9dcc 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -16,7 +16,7 @@ INCLUDES = -I$(top_srcdir)/lib/libalpm AM_CFLAGS = -pedantic -D_GNU_SOURCE vercmp_SOURCES = vercmp.c -vercmp_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la +vercmp_LDADD = $(top_builddir)/lib/libalpm/version.o testpkg_SOURCES = testpkg.c testpkg_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la diff --git a/src/util/vercmp.c b/src/util/vercmp.c index 778ac55a..959dc137 100644 --- a/src/util/vercmp.c +++ b/src/util/vercmp.c @@ -23,12 +23,14 @@ #include /* printf */ #include /* strncpy */ -#include - #define BASENAME "vercmp" #define MAX_LEN 255 +/* forward declaration, comes from vercmp.o in libalpm source that is linked in + * directly so we don't have any library deps */ +int alpm_pkg_vercmp(const char *a, const char *b); + static void usage() { fprintf(stderr, "usage: %s \n\n", BASENAME); -- cgit v1.2.3-70-g09d2