From 75b15cd92cedc9bbdc36c72b198eaf5a64165e48 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 1 May 2012 16:02:09 +0200 Subject: [PATCH] configure: drop dependency with libtool --- debian/control | 2 +- m4/libevent.m4 | 56 +++++++++++++++++++++-------------------------- redhat/lldpd.spec | 1 - 3 files changed, 26 insertions(+), 33 deletions(-) diff --git a/debian/control b/debian/control index d39e75dd..7c6be507 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Vincent Bernat Build-Depends: debhelper (>= 5), cdbs, autotools-dev, libsnmp15-dev | libsnmp9-dev | libsnmp-dev, - libxml2-dev, libevent-dev, pkg-config, libtool + libxml2-dev, libevent-dev, pkg-config Standards-Version: 3.8.4 Homepage: https://trac.luffy.cx/lldpd/ diff --git a/m4/libevent.m4 b/m4/libevent.m4 index 29b104c2..0d056c0f 100644 --- a/m4/libevent.m4 +++ b/m4/libevent.m4 @@ -6,7 +6,6 @@ AC_DEFUN([lldp_CHECK_LIBEVENT], [ LIBEVENT_URL=http://libevent.org/ _save_LIBS="$LIBS" _save_CFLAGS="$CFLAGS" - _save_CC="$CC" # First, try with pkg-config PKG_CHECK_MODULES([LIBEVENT], [libevent >= 1.4.3], [], [:]) @@ -14,7 +13,28 @@ AC_DEFUN([lldp_CHECK_LIBEVENT], [ AC_MSG_CHECKING([how to compile with libevent]) if test x"$1" = x -o x"$1" = x"yes"; then # Nothing specified, use default location from pkg-config - : + LIBS="$LIBS $LIBEVENT_LIBS" + CFLAGS="$LIBEVENT_CFLAGS $CFLAGS" + AC_TRY_LINK([ +@%:@include +@%:@include +@%:@include ], [ event_base_new(); ], + [ libevent_linked=yes ], [ libevent_linked=no ]) + + if test x"$libevent_linked" = x"yes"; then + AC_MSG_RESULT([ok with $LIBEVENT_LIBS $LIBEVENT_CFLAGS]) + else + if test x"$LIBEVENT_LIBS" = x; then + AC_MSG_RESULT([no libevent]) + else + AC_MSG_RESULT([failed with $LIBEVENT_LIBS $LIBEVENT_CFLAGS]) + fi + AC_MSG_ERROR([ + *** libevent 2.x is required. Grab it from $LIBEVENT_URL + *** or install libevent-dev package]) + fi + LIBS="$_save_LIBS" + CFLAGS="$_save_CFLAGS" else # Black magic.... if test -d "$1"; then @@ -41,6 +61,7 @@ AC_DEFUN([lldp_CHECK_LIBEVENT], [ break fi done + AC_MSG_RESULT([ok with $LIBEVENT_LIBS $LIBEVENT_CFLAGS]) ;; *.tar.gz) # This won't work for cross compilation. Dunno how to handle this. @@ -73,7 +94,6 @@ AC_DEFUN([lldp_CHECK_LIBEVENT], [ } LIBEVENT_CFLAGS=-I`readlink -f "$levdir/../include"` AC_MSG_RESULT([successful!]) - AC_MSG_CHECKING([how to use this fresh new libevent]) ;; *) AC_MSG_RESULT(failed) @@ -86,33 +106,7 @@ AC_DEFUN([lldp_CHECK_LIBEVENT], [ fi fi fi - - # Can I compile and link it? We need to use libtool - LIBS="$LIBS $LIBEVENT_LIBS" - CFLAGS="$LIBEVENT_CFLAGS $CFLAGS" - CC="${SHELL-/bin/sh} libtool link $CC" - AC_TRY_LINK([ -@%:@include -@%:@include -@%:@include ], [ event_base_new(); ], - [ libevent_linked=yes ], [ libevent_linked=no ]) - - if test x"$libevent_linked" = x"yes"; then - AC_SUBST([LIBEVENT_LIBS]) - AC_SUBST([LIBEVENT_CFLAGS]) - AC_MSG_RESULT([ok with $LIBEVENT_LIBS $LIBEVENT_CFLAGS]) - else - if test x"$LIBEVENT_LIBS" = x; then - AC_MSG_RESULT([no libevent]) - else - AC_MSG_RESULT([failed with $LIBEVENT_LIBS $LIBEVENT_CFLAGS]) - fi - AC_MSG_ERROR([ -*** libevent 2.x is required. Grab it from $LIBEVENT_URL -*** or install libevent-dev package]) - fi - CC="$_save_CC" - LIBS="$_save_LIBS" - CFLAGS="$_save_CFLAGS" + AC_SUBST([LIBEVENT_LIBS]) + AC_SUBST([LIBEVENT_CFLAGS]) ]) diff --git a/redhat/lldpd.spec b/redhat/lldpd.spec index 214780df..2f126e51 100644 --- a/redhat/lldpd.spec +++ b/redhat/lldpd.spec @@ -38,7 +38,6 @@ Source1: lldpd.init%{?suse_version:.suse} Source2: lldpd.sysconfig BuildRequires: pkgconfig -BuildRequires: libtool BuildRequires: libevent-devel %if %{with snmp} BuildRequires: net-snmp-devel -- 2.39.5