]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
configure: drop dependency with libtool
authorVincent Bernat <bernat@luffy.cx>
Tue, 1 May 2012 14:02:09 +0000 (16:02 +0200)
committerVincent Bernat <bernat@luffy.cx>
Tue, 1 May 2012 14:04:24 +0000 (16:04 +0200)
debian/control
m4/libevent.m4
redhat/lldpd.spec

index d39e75ddb20b8c2ad0e35a5824910ce980a59b0c..7c6be507979170c8672f6854e89b9220223557b3 100644 (file)
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Vincent Bernat <bernat@debian.org>
 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/
 
index 29b104c28221896fb6ff55562afcfacea8bae53e..0d056c0fa3fe4cfab03e212283e0d68d863dfab4 100644 (file)
@@ -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 <sys/time.h>
+@%:@include <sys/types.h>
+@%:@include <event2/event.h>], [ 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 <sys/time.h>
-@%:@include <sys/types.h>
-@%:@include <event2/event.h>], [ 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])
 ])
index 214780df1f147bd4bf6df5afbb0284b03d129e98..2f126e51c8fe31610c05c4888313bf72278df2a7 100644 (file)
@@ -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