autoconf: fix up libevent autoconf test
authorJeff Layton <jlayton@redhat.com>
Fri, 23 Dec 2011 14:04:54 +0000 (09:04 -0500)
committerSteve Dickson <steved@redhat.com>
Thu, 5 Jan 2012 20:42:40 +0000 (15:42 -0500)
Have it set LIBEVENT to -levent and use that in the Makefiles instead
of hardcoding it.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
aclocal/libevent.m4
utils/idmapd/Makefile.am

index 3c962b3..b5ac00f 100644 (file)
@@ -2,8 +2,9 @@ dnl Checks for libevent
 AC_DEFUN([AC_LIBEVENT], [
 
   dnl Check for libevent, but do not add -levent to LIBS
-  AC_CHECK_LIB([event], [event_dispatch], [libevent=1],
+  AC_CHECK_LIB([event], [event_dispatch], [LIBEVENT=-levent],
                [AC_MSG_ERROR([libevent not found.])])
+  AC_SUBST(LIBEVENT)
 
   AC_CHECK_HEADERS([event.h], ,
                    [AC_MSG_ERROR([libevent headers not found.])])
index 4328e41..f8578b0 100644 (file)
@@ -16,7 +16,7 @@ idmapd_SOURCES = \
        nfs_idmap.h \
        queue.h
 
-idmapd_LDADD = -levent -lnfsidmap ../../support/nfs/libnfs.a
+idmapd_LDADD = $(LIBEVENT) -lnfsidmap ../../support/nfs/libnfs.a
 
 MAINTAINERCLEANFILES = Makefile.in